Create link to line?

You could use this as an alternative. Select text to form a unique string and fire the script. It will copy the item url and attach a command for it to search for the string you selected. It works pretty well for me for plain text files. Eventually I use for PDFs as well.

tell application id "DNtp"
	set theRecord to (content record of think window 1)
	set theSelection to the selected text of think window 1 as string
	set theSelection to my replaceText(theSelection, " ", "%20")
	set theURL to get the reference URL of theRecord & "?search=" & theSelection
	set the clipboard to theURL
	
end tell

on replaceText(theString, old, new)
	set {TID, text item delimiters} to {text item delimiters, old}
	set theStringItems to text items of theString
	set text item delimiters to new
	set theString to theStringItems as text
	set text item delimiters to TID
	return theString
end replaceText
3 Likes