Assigning keyboard shortcut to a Group or Item

In DEVONthink Pro Office is it possible to assign a keyboard shortcut to (a) a Group and (b) an item within a Group, if so how? N.B. I do have Keyboard Maestro. Thanks.
Andrew-Bede

No… but why? What are you trying to do?

It’s easier to just have the Groups and Tags menu open, or open it with a shortcut.

You could write a script that KM would execute with a shortcut to open your group.

Or you can make a bookmark in your browser with the URL of a DEVONthink group and click that bookmark to open the group.

All of which leads back to Jim’s question – “why”?

I do this all the time. I have a smart group that holds a scratchpad of documents I am working on and referring to constantly in a database (such as all flagged documents). Its very useful to have this available at a single keystroke.

Smart groups don’t appear in the Group and Tags HUD.

To this end here is a very generalised short script to open any folder or file with the specified comment.

(I know there are simpler ways to find the UUIDs of files and folders but some variation of the following technique is the only method I have found to discover the UUID of a smart folder.)

tell application id "DNtp"
	--set the spotlight comment of the smart group, group or document to the following string
set specialComment to "OpenMeNOW"
	set temp to (lookup records with comment specialComment)
	set theResult to open window for record (item 1 of temp)
end tell

Allocate a keystroke to the script in the normal way for one key access.

Frederiko

Name is “korm” – thanks

Apologies korm - typo

Frederiko

Frederiko has explained “Why” well and I thank him for the script. :slight_smile:

The posting just below this one has an even better idea

Here’s an alternative using Keyboard Maestro and no scripting required.

  1. Copy to the clipboard the item link for a group, or document
  2. In some folder in DEVONthink make a bookmark Data > New > Bookmark, with a meaning name and paste the item link there
  3. Drag the bookmark to some folder in the Finder – if you are going to go a lot of this, then make a folder in ~/Documents, for example to hold all of your links.
  4. In Keyboard Maestro make a macro like this (the .inetloc file is the one I exported in step (3)

I put this macro on the global macro palette – you could make your own palette with lots of options if you wish to have a number of group or documents links available. Frederiko’s approach is great, but it requires a new script for each link. (At least, in the present incarnation).

And it can be even simpler than what I posted above – just use the “Open URL” command in Keyboard Maestro, like this:

korm this is just what I need, :slight_smile: please forgive my ignorance but how do you locate the URL of the desired item? Thanks for you kind assistance.
Andrew-Bede

Control click the group or document and chose “Copy Item Link” from the contextual menu – it will be on the clipboard at that point. Or use Edit > Copy Item Link – also on the clipboard at that point. Then paste into the KM URL action as shown. Be sure to tell KM to open the URL with DEVONthink – KM will sometimes fail if it attempts to use Safari to open the URL.

Thanks korm. :smiley: