Hello!
I’ve just begun experimenting with automating DEVONthink Pro. I’m having trouble interacting with the Search window (Tools > Search…) using JXA.
My goal is to create a function which will search a specific database for all documents matching a given string, then list the results in the Search window for previewing. If possible, I’d prefer to do this without using UI automation/accessibility scripting.
I’ve been able to use the Application.search method to get a list of records, and I can iterate over that list to open every record in a new tab within the main ViewerWindow. I see there’s a SearchWindow class defined in the script dictionary, but I can’t seem to make one appear. If a SearchWindow is already open, I can access it through Application.searchWindows, but setting the results property doesn’t work. (If there are search results in the SearchWindow, when I set results to a list returned from Application.search, the window results become empty instead.)
Is it possible to script DEVONthink Pro to list search results from across a database in a new window? If so, what is the best way to do that?
Thanks for any help.