Finding the right Calendar names

I have a few calendars that are just named “Calendar”

In scripts, how do I differentiate between them?

Each calendar has an identifier. The title of the calendar is just a property. Colour (color) is also a property, so if you gave your calendars different colours that might help you determine which is which to get the appropriate identifier, otherwise you will have to change the calendar title, or check the calendar content to determine which identifier belongs to which calendar.

You can dump the calendar information into the console easily enough.

let cals = await Calendar.forEvents();
cals.map(cal => console.log(cal.title + " | " + cal.color.hex + " | " + cal.identifier));

Hope that helps.

1 Like

Thanks!

That is exactly what I needed.