这个单行的Applescript可以在我的Mac上运行良好:
tell application "Finder" to open POSIX file "/Development/Applescript/Rapport.docx"
然而,它失败了一个简单的ApplescriptObjC项目:
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:
我得到的错误是:
*** -[CMDAppDelegate applicationWillFinishLaunching:]: POSIX file "/Development/Applescript/Rapport.docx" of «script» doesn’t understand the “open” message. (error -1708)
我错过了什么?
答案 0 :(得分:3)
我曾经遇到过这个问题而我无法解释这种奇怪的行为,但是有一些重新安排对我有用:
tell application "Finder" to open "/Development/Applescript/Rapport.docx" as POSIX file