Can AppleScript create an Open File Alert

applescriptcalendar

macOS Mojave 10.14.6

I would like to be able to programmatically create repeating calendar events that open a given file when run. I'm using AppleScript within Automator. Creating the repeating events is not hard, but I cannot seem to add an Open File Alert. Is this possible?

I found this old post which was having the same problem and the nearest conclusion was that it's not possible for some inexplicable reason. Does anyone know how to accomplish this?

Best Answer

Quoting Calendar's AppleScript dictionary in macOS Catalina (but applicable since Mojave) :

"This class represents an 'open file' alarm. Starting with OS X 10.14, it is not possible to create new open file alarms or view URLs for existing open file alarms. Trying to save or modify an open file alarm will result in a save error. Editing other aspects of events or reminders that have existing open file alarms is allowed as long as the alarm isn't modified."

Additionally, having tested other types of calendar alarms in Catalina that do not have similar warnings against them, they too failed to be created. Whilst the restriction in place for file alarms is most likely motivated by security concerns, the others feel more like a bug.