The 'CalendarApp' is used to perform the task and we start by getting hold of the relevant calendar.
var calendar = CalendarApp.getCalendarById(calendarId);Next we get an array of the events for our given date.
var allEvents = calendar.getEventsForDay(date);As we now have an array we need to loop through each returned event and extract the Title & Id.
for (var i=0; i<allEvents.length; i++) {
var event = allEvents[i];
var eventTitle = event.getTitle();
var eventId = event.getId();
}
Search for events on date.gs
Hi! Can I use a script to search/ filter for calendar events by colour?
ReplyDeleteHi
DeleteYes it looks like there is a Color option in Apps Script (https://developers.google.com/apps-script/reference/calendar/calendar-event#getcolor).
Kind regards
Phil