Google App Script Batch Delete Calendar Events

After some recent experiments in connecting by Outlook calendar to my Google calendar, I managed to import a couple years worth of reoccurring appointments into my Google calendar. To my surprise, these were not imported as reoccurring appointments, but rather as individual appointments.  To my further surprise, there was no way (at least that I have come across) to delete multiple appointments sharing the same property–i.e. title.  This meant I would have to delete each calendar event one at a time. Crap.

Fortunately I am just starting to learn JavaScript, and Google offers a pretty very useful service called Google App Script that is based off of the JavaScript language.  As I understand it, it is quite similar at least in function to Microsoft’s VBA (Visual Basic for Applications).  The App Script is intended to allow users to modify and extend Google’s suite of services.  This pertains to Google Sheets, Gmail, and several others including Google Calendar.

To the point, here is the function:

This code would need to be run in the Google Script editor by hitting the play button. You would also need to be logged in to the calendar which you are trying to modify. Also note that this is not meant to be a simple UI….as in, there is no undo button.

Helpful links