When I’m in the Mail app I want to be able to Page Up/Page Down, Cmd+Home/End in the Folder list pane, Mail list pane or in an email depending on which pane has the focus. (Or alternatively, maybe use 3 key sets, Ctrl+Page Up/Down, Alt+Page Up/Down and Cmd+Page Up/Down to set the focus to the correct pane and then send the correct key command to do that and a similar set for Ctrl+Home/End, Alt+Home/End, Cmd+Home/End.)
I know KM can tell which app it is in, but I can’t see anyway to know which sub-pane I’m in or how to set the focus to a particular (other than the inelegant kludge of moving the mouse X x Y pixels over, but that depends on me not resizing the target App (here Mail).
BTW, I’m look for a way to tell which sub-pane I’m in, almost as much as I want a way to do this, so I can use that ability elsewhere.
This may work for you, although it only moves the focus to the mailbox list pane — nor is there any error-checking to make sure the pane is open — etc…
tell application "System Events"
tell application process "Mail"
set focused of outline 1 of scroll area 1 of splitter group 1 of window 1 to true
end tell
end tell
I’ve tested only on 10.9.5, and Yosemite’s Mail may have different indices for its parts.
You can determine what pane you’re in with System Events, although working with SEV is complicated.
You can also brute-force the interface by using the search keyboard shortcut to enter the search field and then tabbing forward or backward.
And there’s another trick or two using keyboard shortcuts and AppleScript.
Thanks, but it didn’t in Yosemite. I’ve done a ton of programming on the Windows side using Visual Basic, so programming, per se, doesn’t phase me. Do you know of any reference site where I learn the syntax and which area is which?