Skip to content

Instantly share code, notes, and snippets.

@cappypopp
cappypopp / moveToCalendar.gs
Created August 22, 2022 15:30 — forked from erickoledadevrel/moveToCalendar.gs
Moving events from one calendar to another, using Google Apps Script
/**
* Move events with a given title from your primary calendar to another calendar.
* You must enable the Calendar Advanced Service:
* https://developers.google.com/apps-script/guides/services/advanced#enabling_advanced_services
*/
function moveEvents(eventTitle, fromCalendarName, toCalendarName) {
var fromCalendarId = CalendarApp.getCalendarsByName(fromCalendarName)[0].getId();
var toCalendarId = CalendarApp.getCalendarsByName(toCalendarName)[0].getId();
var now = new Date();