Question

This one-line Applescript works fine on my Mac:

tell application "Finder" to open POSIX file "/Development/Applescript/Rapport.docx"

However it fails from a trivial ApplescriptObjC project:

on applicationWillFinishLaunching:aNotification
    -- Insert code here to initialize your application before any files are opened
        tell application "Finder" to open POSIX file "/Development/Applescript/Rapport.docx"
end applicationWillFinishLaunching:

The error I get is:

*** -[CMDAppDelegate applicationWillFinishLaunching:]: POSIX file "/Development/Applescript/Rapport.docx" of «script» doesn’t understand the “open” message. (error -1708)

What am I missing?

Was it helpful?

Solution

I had the problem once and i can't explain this weird behavior but a little rearrangement worked for me:

tell application "Finder" to open "/Development/Applescript/Rapport.docx" as POSIX file
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top