Hi everyone,
I’ve been searching around for this for several hours now, and I haven’t come to a definitive answer. I’m hoping someone here will know the best approach. I’m building a script (this is the final piece) that will parse some text and write the result to OmniOutliner or OmniOutliner Pro, whichever is installed. Here’s how I’m determining which version is available:
set outlinerApp to "" -- Assume that OmniOutliner isn't installed at all and do something else instead later
tell application "Finder"
try
exists application file id "com.omnigroup.OmniOutliner3"
set outlinerApp to "com.omnigroup.OmniOutliner3" -- OmniOutliner
on error
false
try
exists application file id "com.omnigroup.OmniOutlinerPro3"
set outlinerApp to "com.omnigroup.OmniOutlinerPro3" -- OmniOutliner Professional
on error
false
end try
end try
end tell
Later on in my script when I actually try to create the OmniOutliner document, it’s failing because it can’t get access to the OmniOutliner dictionary. This is my code:
tell application id outlinerApp -- The variable I assigned above
set newDoc to make new document at beginning of documents
tell newDoc -- set up some defaults for the new document
set status visible to false -- hide checkboxes
end tell
-- Other steps skipped for brevity
end tell
I’ve read and read about the “double tell” and a few other solutions, but they seem to pertain to much older version of OS X or AppleScript.
What’s the current best practice to accomplish something like this?
-Tim