Created
March 22, 2016 16:10
-
-
Save woodwardtw/1770c4f6199e4ffc41b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function multiCalEventMaker () { | |
var fromSS = 'Big Events, Small Events, Tiny Events'; //get calendars you want, could be checkbox entries from Google Form | |
fromSS = fromSS.replace(/,\s+/g, ',').toLowerCase(); //gets rid of the space before the comma which ruined my life for too long | |
Logger.log(fromSS); // | |
var calNames = fromSS.split(","); | |
//loops through however many calendars you set above | |
for (i = 0; i <calNames.length; i++) { | |
var calName = calNames[i]; | |
var calId = CalendarApp.getCalendarsByName(calName)[0]; //you'd change the next stuff to integrate whatever variables you want | |
var event = CalendarApp.getCalendarById(calId.getId()).createAllDayEvent('Magic Stuff', | |
new Date('March 25, 2016'), | |
{location: 'The Moon'}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment