Deep linking to specific rows of an OmniOutliner document

Here is the previous “Get Address” script, which does not yield deep links.

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

Sorry for the delay in acknowledging and responding to your feedback. All very helpful.
The new deep-linking feature is great!

1 Like