You could add a shortcut either via system settings or by appending the shortcut to the script’s filename, see help for more information. But both approaches work only while DEVONthink is the active application.
Alternatively a script for the global scripts menu could simply open the current Safari tab in DEVONthink. No need for copying & pasting of URLs:
-- Open current Safari tab in a DEVONthink tab
tell application "Finder" to set pathToAdditions to ((path to application id "DNtp" as string) & "Contents:Resources:Template Script Additions.scpt") as alias
set helperLibrary to load script pathToAdditions
tell application "Safari"
try
if not (exists window 1) then error "No window is open."
tell current tab of window 1
set theURL to URL
if theURL begins with "http://" or theURL begins with "https://" then
set theName to name
tell application id "DNtp" to my helperLibrary's openURLInTab(theURL)
end if
end tell
on error error_message number error_number
if error_number is not -128 then display alert "Safari" message error_message as warning
end try
end tell
Ah, yes. I somehow got the impression @utiPontushage wanted the script to be accessible no matter which application is active, but the Safari folder makes more sense.
@utiPontushage you’re welcome The global script menu is pretty neat. DEVONthink also includes some additional scripts accessed this way for Safari, Chrome, DEVONagent and Apple Mail.
Just wanted to say that this script has really changed my workflow for the better. Big difference! Also got a reason to study some scripting knowledge and more use of my Keyboard Maestro license.
Again, big thanks, there are very few apps or similar digital services with such an active community as well as present developers