Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
You can’t perform that action at this time.