This one liner works fine in the Applescript Editor:
tell application "Finder" to open POSIX file "/Development/Applescript/Rapport.docx"
However, it doesn’t when inserted in a newly created (with Xcode 5.1.1 under Mac OS X Mavericks 10.9.2) 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:
I get the following error message:
I am an experienced Cocoa developer, but an Applescript newbie.
There are a few similar: you can’t use terms like file, alias and date as specifiers, but rather you have to use them as coercions.
These apply only when using ASObjC in Xcode projects – not in ASObjC-based libraries.
(The reason is because specifiers always need a parent specifier, and the parent of an ASObjC class is is a Cocoa class, not AppleScript, and hence the specifier can’t be resolved.)