Set current window to a group

Hi,

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.

open window for record g
activate

thank you,
bosie

I’m not entirely clear on what you’re wanting to see happen. Are you trying to change the selection in the current window or open a new window?

i want to show a different group in the current window. as if i were to click on/select a different group in the current window.

anyone?

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)?

I want to switch to another group via keyboard.
trying to adjust this script Move | Duplicate| Replicate selected records [+LaunchBar] but everything is figured out except for the ‘set the current window to this group’ part.

The technique is as follows

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 :open_mouth:

Ugh! Agreed. :smiley:

@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

Stupid me. I cannot read very well.

You’re not going to be able to put a script into KM that controls DEVONthink better than what you’ve tried before.

guess i have to feature-request this :wink:

but i am wondering, how are you guys switching groups?

I agree it would be a nice addition to the AppleScript directory. (I assume that’s the feature you’re looking to add?)

Mouse or trackpad, for me.

feature request would be for DT to implement the feature themselves: