문제

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?

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top