Skip to content

Instantly share code, notes, and snippets.

@locatejp
Created January 24, 2014 16:42
Show Gist options
  • Save locatejp/8601041 to your computer and use it in GitHub Desktop.
Save locatejp/8601041 to your computer and use it in GitHub Desktop.
Selects all Google Calendars
function selectAll() {
var cals = CalendarApp.getAllCalendars(); //Get all of the calendars
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.toast("This process takes about 2 minutes. Another notification will indicate when complete", "Process Started!", 20);
for ( var i = 0; i <= cals.length-1; i++ ) { //Create a loop and select each one individually
var tempName = cals[i];
if (tempName != "Tasks" && tempName != "Choose From Dropdown" ) // FILTER UNNEEDED CALENDARS
{
tempName.setSelected(true);
}
}
ss.toast("All Calendars Have Been Selected. Please refresh your calendar.", "Process Complete" ,5);
Browser.msgBox('Complete! Please change the calendar *Boomerang Internal Notes* to Blue, and the calendar *Charlotte* to Brick Red. Thanks!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment