In this post AppleScript was provided to open an item in Devonthink.
I now wish to open a Smart Group with AppleScript but when run in AppleScript I get a message within AppleScript to say there is a 'Missing value" and the contents of the Smart Group are not shown in Devnonthink.
property pUUID : "990AD08B-F92B-42CD-B9B2-A99CE8AC88AE"
-- x-devonthink-smartgroup://990AD08B-F92B-42CD-B9B2-A99CE8AC88AE
tell application id "DNtp"
set theDoc to get record with uuid pUUID
open window for record theDoc
end tell
Is it possible to open a Smart Group from AppleScript?
With open window for record it’s only possible to open Smart Groups inside a database (i.e. you can’t open global Smart Groups this way).
To open a global Smart Group use do shell script:
-- Open global Smart Group
property theReferenceURL : "x-devonthink-smartgroup://B47C2D2D-3B9A-4EE5-B3B7-172AC2FE7799"
do shell script "open " & quoted form of theReferenceURL