Script to create a location-specific search link

I’ve hacked/written a script to create and save a link to a DT search:

display dialog "Search text" default answer "" buttons {"Cancel", "OK"} default button 2
set theAnswer to the text returned of the result
set theURL to "x-devonthink://search?query=" & theAnswer & "&open=1”
tell application "DEVONthink 3"
	create record with {name:theAnswer, type:bookmark, URL:theURL} in current group
end tell

However, this searches all databases. Is there a way to modify the URL to search within a specific database or group?

You could use a scope, e.g. to target a database but not the specific group,…

x-devonthink://search?query=test%20scope:File%20Types&open=1

Thanks! That works!

1 Like

You’re welcome :slight_smile: