/**
* List the names and descriptions of calendars the user owns.
* @see https://developers.google.com/apps-script/reference/calendar/calendar-app
*/
function listAllOwnedCalendarsWithDescriptions() {
const calendars = CalendarApp.getAllOwnedCalendars(); // Get all calendars the user owns
Logger.log('You own %s calendars.', calendars.length); // Log how many calendars are owned
calendars.forEach(calendar => { // Loop through each calendar
const name = calendar.getName(); // Get the calendar's name
const description = calendar.getDescription(); // Get the calendar's description
Logger.log('Calendar Name: %s\nCalendar Description: %s', name, description); // Log the name and description
});
}
/**
* List the names and descriptions of calendars the user can access.
* @see https://developers.google.com/apps-script/reference/calendar/calendar-app
*/
function listAllOwnedCalendarsWithDescriptions() {
const calendars = CalendarApp.getAllCalendars(); // Get all calendars the user owns
Logger.log('You can access %s calendars.', calendars.length); // Log how many calendars are owned
calendars.forEach(calendar => { // Loop through each calendar
const name = calendar.getName(); // Get the calendar's name
const description = calendar.getDescription(); // Get the calendar's description
Logger.log('Calendar Name: %s\nCalendar Description: %s', name, description); // Log the name and description
});
}