… will not work from within a link in an RTF file in DEVONthink (it just reveals the document in DEVONthink), yet if I paste it into BBEdit and choose that app’s Open URL contextual menu selection, the link opens the item in Scapple.
The use case of, say, keeping ‘monitoring’ notes to a larger document that I’m working on. Those notes contain links to other files somewhere in DEVONthink. It would be good to be able to open some of those links in one app and some in another (i.e., not always the OS’s ‘default’).
Ah, sorry, I worded that badly. What I meant was, “links for certain external apps”. That is, appending certain apps in the link (like TextEdit), doesn’t work in external apps. So, for example, using BBEdit’s ‘Open URL’ contextual menu selection:
And I suppose once you’ve copied an item link, you could use an AppleScript something like the one below to put the ‘external app link’ in the clipboard, ready to paste into the external app, as that app’s link:
set theData to (the clipboard as text)
set the clipboard to (get (the clipboard) & "?openexternally=1&app=")
set anApp to choose application with title "Choose app:"
set appName to name of anApp
set the clipboard to (get (the clipboard) & appName)
set x to (get (the clipboard))
set the clipboard to (my findReplace(text 1 thru -1 of x, " ", "%20"))
on findReplace(t, toFind, toReplace)
set {tid, text item delimiters} to {text item delimiters, toFind}
set t to text items of t
set text item delimiters to toReplace
set t to t as text
set text item delimiters to tid
return t
end findReplace
set d to (get (the clipboard))
display dialog d with title "Copied"
If you cancel out of the app choice dialog, the resulting link will still open the linked file in the default app you’ve set in macOS for that file type.