i have a record variable holding a group. i am wondering how i can use this to set the current window to the group?
the only thing i got so far is how to open a window and set it to the record/group.
Nope. Note finding a way to accomplish this, bosie. In, fact, I think there may need to be a small correction in the AS dictionary. It appears that “selection” as a properties of a viewer window is not read only, but behaviorally it appears it is.
I will ask Criss about this but so far I can’t find a way to change the selection in the main window.
BTW, what are you trying to do this for? Do you really need to change the selection (I’m assuming so but have to ask)?
tell application id "DNtp"
set currentDatabase to current database
set theGroup to create location "/TESTING" in currentDatabase
set theTemp to open window for record theGroup
end tell
This will open a new window focused on the group. AFAIK, it is not possible to switch groups in the current window, although one can open a group in a (very useless no-content) tab.
The syntax “create location” will not create a new group if one exists at the path, but is intelligent enough will merely load the existing group address into theGroup.
The solution has nothing to do with the selection property. Selection is merely a list of the currently selected records – groups and documents are records. One cannot set selection programmatically. DEVONthink monitors and sets selection internally. You could of course use Keyboard Maestro (or similar) to screen scrape the window, select records, and therefore spoof selection. That is too painful to test
@korm: thats what i had in the first post. the window that gets opened is just too modified. e.g. the group list isn’t normal but shows only the sub-groups of the group. executing ‘go enclosing group’ collapses the group for whatever reason, so that doesn’t seem to be a viable solution either.
the keyboard maestro idea… not sure how that would work but maybe the group ‘entries’ have a description or something that i can use from applescript. will look into that