Skip to content

applescript – Unable to open file with Finder via Apple Script

  • by
Spread the love

I have been using an Apple Script that recently stopped working (on macOS 12.4-6). Here is a minimal piece of code:

tell application "Finder"
    open "Macintosh HD:Users:me:cal.ics"
end tell

This used to open up the file in Calendar with a few dialog boxes asking how I want to import the calendar (and this is still what happens if I double-click the file in Finder, or if I run $ open cal.ics in the terminal). Now however, when I run the above Apple Script, nothing happens in Calendar. Weirdly though, the Date last opened property of cal.ics updates to the time the Apple Script is run.

Does anyone have any idea how to fix this? Or an alternative that’s not too complex (I can’t seem to get Calendar itself to open or import this file via Apple Script). In the worst case, I could tell Terminal to run $ open cal.ics, but I’d like to try to keep the script simple.

Leave a Reply

Your email address will not be published. Required fields are marked *