As far as I know, there are no way to get this new kind of link via AppleScript, only via GUI. So, I tried to compile without GUI
base link - no problem
page number is a current page property of window
search string you can make using escapeURL command from Satimage scripting addition, or using AppleScript ObjC
length is the characters value of selected text property
The only thing I don’t know - is how to get the start value, as the number of the first selection char from the beginning of the document? @cgrunenberg?
It is good that you can use just “page and search”, but “start and length” solution is more stable because the search phrase may not be unique for this page.
So, is there a way to get the start char number?
Or waiting for “selection link” AppleScript function in the next release? )
encodeURIComponent("Just a test")
on encodeURIComponent(uri as text)
run script "encodeURIComponent(" & (the quoted form of uri) & ");" in "JavaScript"
end encodeURIComponent