I want to bind a key to set input focus to the list of notes. DEVONthink has the control-shift-tab key available for changing focus to different panels, but you may have to invoke it multiple times in a row depending on where your focus is currently, whereas I want to implement a keyboard shortcut to move back to the notes list from anywhere in a single keystroke. I could do this via KeyboardMaestro, but what I lack is an AppleScript example of how to select the list of notes.
Can anyone point me to some AppleScript code to set focus on the notes list?
That’s unfortunate, but I find something strange about this: clearly, DEVONthink can change the input focus somehow (because it offers a keyboard shortcut to cycle through the elements that get focus). So, it must also have an internal list of GUI elements that can receive input focus and a mechanism to select from that list programmatically. Is the problem that there is no standard AppleScript method to do it in general? In that case, would it be possible for DEVONthink to expose a function to AppleScript to let the user invoke it?
-- Focus on Records List
activate application "DEVONthink Pro"
tell application "System Events"
tell process "DEVONthink Pro Office"
try -- Symbols
set focused of scroll area 1 of group 1 of splitter group 1 of splitter group 1 of window 1 to true
end try
try -- List
set focused of outline 1 of scroll area 1 of group 1 of splitter group 1 of splitter group 1 of window 1 to true
end try
try -- Columns
set focused of scroll area -2 of scroll area 1 of browser 1 of splitter group 1 of group 1 of splitter group 1 of splitter group 1 of window 1 to true
end try
try -- Two pane
set focused of outline 1 of scroll area 1 of splitter group 1 of group 1 of splitter group 1 of splitter group 1 of window 1 to true
end try
try -- Three pane / Tags
set focused of outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of group 1 of splitter group 1 of splitter group 1 of window 1 to true
end try
end tell
end tell