I’m happy with Mojave but unhappy that my previously working code doesn’t add file alarms anymore. Try by yourself :
tell application "Finder" to set flpt to item 1 of (get the selection)
set due_dt to (current date) + (5 * minutes)
tell application "Calendar"
tell calendar my_cal
set the_Event to make new event at end of events with properties {end date:due_dt, summary:"test"}
tell the_Event
make new open file alarm at end of open file alarms with properties {trigger interval:-5, filepath:POSIX path of (flpt as text)}
end tell
end tell
end tell
What is flpt exactly? If it’s AppleScript alias then you should’ve left it as is because POSIX path is a property of class “alias” of AppleScript.
Also, as of Mojave, in Calendar and Reminders, all objects (events, alarms etc.) are made at the end of their parent object, not a list containing them. E.g.
tell application "Calendar"
tell MyEvent
make new open file alarm with properties {any_properties} at the end of it
end tell
tell MyCalendar
make new event with properties {any_properties} at the end of it
end tell
end tell
Update To answer my own question, looks like flpt variable must be an AppleScript alias but in fact it’s a Finder reference. To coerce it to AppleScript alias you need to re-write the part with setting flpt as
set flpt to (item 1 of (get the selection)) as alias