Setting the selection with scripting
Posted: Thu Mar 19, 2020 6:26 pm
What's the best way to select or reveal multiple Bookends references in a script? E.g., given a set of Bookends IDs, is there a way to show all of them in the front library window?
The command: doesn't seem to work, and filters/sql searches just return the data in scripting, rather than manipulate the window to reveal the result.
I imagine I can make a group, but I'm really just looking to display a set of references, so creating groups is a bit more permanent than I'm hoping for.
Here's the use case, in case it helps. I have DEVONthink records with Bookends id metadata, sometimes multiple such IDs (e.g., if a Book file relates to multiple chapters listed as references in Bookends). If a record only has one Bookends id, I can just prepend the Bookends url ("bookends://sonnysoftware.com/") and use open location to reveal that item. The problem is these multi-ID records. It is trivial to build a list of them as either ids or as actual library items or publication items in Bookends, but I can't figure out what to do with those objects to reveal them in a Bookends window.
The command:
Code: Select all
set selected publication items
I imagine I can make a group, but I'm really just looking to display a set of references, so creating groups is a bit more permanent than I'm hoping for.
Here's the use case, in case it helps. I have DEVONthink records with Bookends id metadata, sometimes multiple such IDs (e.g., if a Book file relates to multiple chapters listed as references in Bookends). If a record only has one Bookends id, I can just prepend the Bookends url ("bookends://sonnysoftware.com/") and use open location to reveal that item. The problem is these multi-ID records. It is trivial to build a list of them as either ids or as actual library items or publication items in Bookends, but I can't figure out what to do with those objects to reveal them in a Bookends window.