I have a script to calculate Lawn Chemical application which I use once a year. Last year in Mojave, everything worked fine. Now on new laptop (16" MBPro) and using Catalina. Having no joy trying to set a new event using Applescript below. Can anyone reproduce? Suggestions?
set datelist to {date "Saturday, April 11, 2020 at 9:00:00 AM"}
tell application "Calendar"
activate
set mylist to the name of every calendar as list -- get names of all calendars
-- use list for user to choose what calendar events should be added to
set tCalendar to choose from list mylist with title "Calendar Selector" with prompt "Which calendar do you want to add these events to?" OK button name "OK" cancel button name "Cancel" without multiple selections allowed and empty selection allowed
set y to 1
repeat with x in datelist
tell calendar (item 1 of tCalendar)
set theEvent to make event at end with properties {allday event:false, description:"Do the lawn treatment!", start date:(current date), end date:((current date) + 1 * hours), summary:"Apply lawn treatment"}
tell theEvent to make new display alarm at end with properties {trigger interval:-15}
set y to y + 1
end tell
end repeat
end tell
fails at âset theEventâŚâ line with this:
Calendar got an error: Failed to save event [Apply lawn treatment] with error [{
CalAlarmUID = âACA24D0C-45D6-4826-83D2-DC95143FFCFDâ;
CalCalendarItemUID = â7E7FE972-DAB1-44C2-975B-3718B159D111â;
CalCalendarUID = â32E33082-0A58-489E-B4FC-2A3803909226â;
CalManagedObjectType = CalManagedAlarm;
NSLocalizedDescription = âaction is a required value.â;
NSValidationErrorKey = action;
NSValidationErrorObject = â<CalManagedAlarm: 0x600003735360> (entity: Alarm; id: 0xa81702f2a210db x-coredata://4C493856-A93D-458D-8CEE-6B00AD3D6217/Alarm/p7402; data: {\n absoluteTrigger = nil;\n acknowledged = nil;\n action = nil;\n bookmark = nil;\n calendar = nil;\n defaultAlarmByReference = nil;\n defaultAlarmSetEventAllDay = nil;\n defaultAlarmSetEventTimed = nil;\n deleteSyncRecord = nil;\n emailAddress = nil;\n isDefaultAlarm = 0;\n isTimeToLeaveAlarm = nil;\n itemCustomAlarm = nil;\n itemLocalDefaultAlarm = nil;\n itemServerDefaultAlarm = nil;\n location = nil;\n message = nil;\n notRelativeToTravel = 0;\n omitSyncRecord = nil;\n order = 0;\n parentAlarmsByValue = nil;\n proximity = nil;\n relatedTo = nil;\n relativeTrigger = â-900â;\n sound = nil;\n subject = nil;\n timeToLeaveDate = nil;\n timeToLeaveEstimatedTravelTime = nil;\n timeToLeaveTrafficDensityString = nil;\n timeToLeaveTransportType = nil;\n uid = nil;\n unrecognizedICSProperties = nil;\n url = nil;\n urlString = nil;\n})â;
}]