@rkaplan I wrote a macro similar to you and have the same problem, I have to press the enter key manually at the end (I deleted the last Return in the snapshot below). I tried substitute keys like cmd-Enter but nothing works. I have never seen this.
@pete31. Yes item (document) links work fine in KBM. Example below.
I could not find in DT if GROUPS have unique links or UUIDs which I could use the same way.
-- Set window root to group
set theGroupUUID to "7B34C1CC-3652-4C07-9AA7-8C5136B23EDB" -- insert group UUID here
tell application id "DNtp"
try
set theGroup to (get record with uuid theGroupUUID)
if exists (viewer window 1) then
set root of viewer window 1 to theGroup
else
open window for record theGroup
activate
end if
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
return
end try
end tell
very elegant. Bravo ! I replaced my macro with it. Another reason why your script helps is that I have many groups containing “inbox” (for historical reasons related to evernote import), so you AppleScript targets exactly the inbox I want.
thank you very much
Do you need the shortcut system-wide or just within DEVONthink? In the second case you could add the groups to the favorites and define shortcuts via System Preferences for the items in Go > Favorites.
yes, exactly. I did not formulate my question properly. that was the issue. thank you. The solution with be to convert to non global smart group. thank you
I have been pestering you enough this morning. I am just posting this question. Please feel free to ignore it if you are busy or tired.
I like your script very much. It navigates to groups, including smart groups when they are not global (I just tested it).
I want to use your script to create a keyboard maestro menu to navigate the context menu.
I run into the problem of the fact that although the group is indeed highlighted, the mouse cursor does not follow, so that I can’t trigger the context menu with a KBM right click action. Is there any way to both highlight the group and put the cursor on it ?
I mention this because it may be useful for you and other KBM users
thanks !
You could try to use a Keyboard Maestro “Found Image” action (not sure that’s the exact name). This would rely on the sidebar’s selection color and might work or fail depending on the current group name (because the image you would use in Keyboard Maestro of course doesn’t change but the letters in different group names do). Might be possible but won’t work reliable, I think.
What parts of the context menu do you want to replicate in a KM palette? Most of it is accessible via the normal menu too, I think.
mostly Edit… which does not seem accessible via the menu.
Reason is that I create a dummy smartgroup which I am constantly editing to do my searches, instead of the search bar. It is a DevonThink Tip and works well
I have quite a lot experience with KM click at found image action. It is a real pain. Often does not work, and when it does, than stops working for some reason.
thank you
Why don’t you just add the groups as Favorites then assign a hotkey to the item in the Go > Favorites menu? You can even open databases with this method.