AppleScript to Make New Calendar in Specific Account
The AppleScript Dictionary for macOS Calendar 10.0 (High Sierra) appears to have no API for addressing specific accounts.
For example…
set myCalendar to make new calendar with properties {name:"New Girl"}
…creates a calendar "On My Mac." There seems to be no way to create a calendar in an iCloud or other calDAV account.
Have I had insufficient caffeine, or is the answer just plain "No"?
You could use GUI scripting like this...
tell application "System Events"
click menu item "iCloud" of menu 1 of menu item ¬
"New Calendar " of menu 1 of menu bar item ¬
"File" of menu bar 1 of application process "Calendar"
end tell
But one of the problems with this solution is you cannot set the properties of the calendar. The new calendar will be named "Untitled"