I'm trying to write an AppleScript that clears a calendar (an iCloud one) of all of its events. I have the following:
tell application "Calendar" tell calendar "Test calendar" set the_events to every event repeat with current_event in the_events delete current_event end repeat end tell end tell
In the Script Debugger, I can see that the number of events in the list
the_events is going down as it deletes each one. If I run the script again, Script Debugger tells me that there are now no events in the calendar. However I can still access and change the events in the Calendar app, be that on the same computer or on another device or the iCloud website.
What's going on here?