use scripting additions
use framework "Foundation"
property NSURL : a reference to current application's NSURL
tell application id "com.omnigroup.OmniOutliner5"
set f to file of front document
set p to POSIX path of f
if (package folder of (info for p) is true) and (character -1 of p is "/") then
-- package, chomp trailing '/'
set p to (characters 1 through -2 of p) as string
end if
set rawUrl to NSURL's fileURLWithPath:p
set p to rawUrl's absoluteString
set filepath to (p as string)
return filepath
end tell
I know this thread is some years old but I was wondering if I could use the previous script also for OmniOutliner 6 without any issues (with changing tell application id “com.omnigroup.OmniOutliner5” to com.omnigroup.OmniOutliner6 of course) or if there is a newer script to just copy the file link instead of the deep link?
I have found it is more reliable to simply select the line you want in OO. Choose “Copy Omni Link” from the Edit menu. And then hook to that copied link with Hookmark.
Hookmark comes with an OmniOutliner 6 script. I use it multiple times a day. You might need to update to the latest version of Hookmark to get the latest script.
I am sorry, I wasn’t clear enough. I was referring to the “Previous script” mentioned above that has the Get Adress section getting the link to the file itself instead of the deep link. I tried it myself and just changed the 5 to 6 in the script. So far No issues.
I see. . Thanks for clarifying. We have considered providing two commands, one to get a deep link the other to get a link to the file itself. But we have held off in order to keep the UI as simple as possible. There’s already a lot of commands in the UI. We’ve had to put some in the Advanced menu.