Thanks! I've been having pretty good luck so far with the most basic (y=archive, s=star, #=trash, gi=go to inbox) with a mixture of Menu Items and Applescript, relying on the "a focused window title does not match ([^)]+)$ filter.
But I'm still struggling getting Applescript to select the next message in the list (for j/k support). Seems like this should be fairly easy (and probably is!) but I'm not having luck finding that magical combination of Applescript commands.
Those are the keyboard commands I'm trying to replicate while using Apple Mail.
Tbh using the gmail web interface + keyboard is my preferred way to use email, it's amazing. I just want to be able to move away from using Google services.
There may be better ways of doing it, but I generally assume that if the 'cut' menu item (under 'Edit') is active, then the user is either entering text or could be entering text.
This one using @JMichaelTX 's "Show Substitutions" trick is working pretty well for me.
Group scoped to Mail application
Macros [do thing] if Show Substitutions isn't around
If it is around, it passes the hot key through
Works for finding. Doesn't universally work for help, but if you open a compose window it will (and I barely use help so it's not really an inconvenience). If someone wants to go bananas for help, perhaps pixel-checking would work.
I found an even faster way to do this. Whenever a text field is selected Mail will enable Edit/Complete, and when a text field isn't selected Mail will disable Edit/Complete.
So I use a If Then Else Macro like this for a Mail macro folder.
Thanks @pond - is working well for me. I was having problems when searching the inbox with it not passing through letters from these shortcuts, but with this addition both the gmail shortcuts and search working fine!
This is working well for me, too, but I run into problems when I trigger Alfred while Mail is (otherwise) the frontmost application and I'm not in a text-entry field in Mail. In that scenario, I'm unable to use in Alfred any of the keystrokes that I've assigned to Gmail-style Macros in Mail. Has anyone else encountered the same problem and managed to identify a workaround?
You can test for the presence of Alfred's input window with AppleScript UI-Scripting.
tell application "System Events"
tell application process "Alfred"
return count of (get windows)
end tell
end tell
Highjacking normal characters for hotkeys is frequently asking for trouble. There are sometimes workarounds that function for the most part, but you almost always end up with clunky typing slowdowns and/or other problems.
You're generally better off adding Control, Option (or other modifiers) to your hotkeys. You still have the mnemonic keystroke but with an added modifier, and this does not interfere with normal typing.
Thanks, Chris. The warnings are well-taken, and I suspect I'll eventually abandon this approach. For now, though, your solution is -- as promised -- working "for the most part." Using the macro below (adjusted appropriately for each letter), I'm able to use the GMail keyboard shortcuts in Mail, while still being able to type them if there's an Alfred window open and Mail is the active application. There's a very slight delay when I type them in Alfred, enough that trying to type "Keyboard Maestro" might result in "eyKboard Maestro." But there doesn't appear to be a similar delay when I'm typing in a Mail message (presumably because the first "if" condition isn't met, and therefore Keyboard Maestro doesn't need to run the script), and it's a certainly better than anything I would have come up with. I appreciate the assistance very much!
For what it’s worth I’ve started to learn the standard Apple mail shortcuts (sheesh they’re complex) because most of them are identical on iPadOS so it becomes more widely useful to me.