Problem using search scope in an applescript

My raw search is “kind:ordinarytag name:<-Journal scope:Devonthink
(retrieved from the search panel)
The scope is limited to database Devonthink

Using the same search in an applescript
set theTags to search “kind:ordinarytag name:<-Journal scope:Devonthink”
I’m getting duplicates because the scope is all databases

In AppleScript search doesn’t work with scope:, you need to search in a record. If you want to search the whole database use

in root of database "Devonthink".

1 Like

Thanks, that solved my issue

fwiw This was also discussed at Search through all databases via AppleScript

1 Like