I use Keyboard Maestro to launch my most used programs, like MS Word using hotkeys (like COMMAND OPTION W ). This launches the closed program and works great. But, like all open programs, eventually it gets covered with other programs that I have open. What I would like to do is to use the same hotkey to bring the program to the front? Is that possible?
As I’ve written before, there are many ways to launch and activate applications using different Mac automation applications. But sometimes there might be subtle differences between the type of action you use to trigger an action like launching or activating an application.
In the case of Keyboard Maestro, there are several ways to launch or activate applications. First off, to answer the above question, the action, “Activate a Specific Application” will both launch and activate a designated application. Activate means the application is brought to the forefront of all other applications.
If you’re new to Keyboard Maestro, you can find the “Activate a Specific Application” action in the Actions library. Actions are listed alphabetically, or you can find it in the Application Control category along with several other application related actions. You can also do a search for it in the library.
Triggering Actions
With the “Activate a Specific Application” action, as with all actions, you can assign one of several triggers to trigger the action. The most common trigger is to use the keyboard shortcut.
However, I personally find shortcuts difficult to remember. So I typically map an assign a shortcut created in KM to a BetterTouchTool finger gesture. I prefer to trigger some actions when my hand is already on the trackpad.
I also like using string triggers, which work keyboard shortcuts, but a string consists of typing a few letters to trigger a macro/action. So for example if I want to quickly switch to Mail while typing, I can simply type, “,mail” to activate the application.
I can also activate an application using a Dragon Dictate voice command. Dragon Dictate will by default launch or activate any application with the simple command, “Activate [name application]”.
And one additional trigger that I like to use is the time trigger. Keyboard Maestro is one of the only applications that allows for setting actions to trigger at a specified time and day. You can set it to open websites, applications, take screenshots, or posts notes.
Other Application Actions
As you can see in the Application Controls category of Keyboard Maestro, there’s about dozen other related application actions.
One particular one that I like using is, “Activate Last Application”, which I have mapped to a BetterTouchTool finger gesture. If my hand is already on the trigger, I spread my thumb and two fingers to switch back the previous application I was using. The action is really useful for when I find myself switching back and forth between programs to get something done.
As you can see in the BTT setup above, the assigned gesture triggers the assigned keyboard shortcut for the macro in Keyboard Maestro. I never manually use the shortcut, and couldn’t remember it if I tried.
Your Question?
You have an Ask Mac Automator question? Write and send the question here, and if it’s useful for other readers, I will post it in this column.
Also let me know your feedback on these actions. Do you have other other ways in which you launch Mac applications, files, and URLs?
Great article! Ultra-quick app switching is crucial to me since I have an 11″ MBA. My group of activators says they’ve saved me 16 hours!
When using `Activate specific application`, I found that the option, “If already at the front: ‘hide the application'” is awesome.
Sometimes I just need to switch over to my music player (⌘⇧⌃⌥ + M) to see what’s playing or something like that. Once I do that, I don’t have to move my fingers to ⌘⇧⌃⌥ + W for my web browser, I just keep them where they are on ⌘⇧⌃⌥ + M to hide the music player and shoot me right back to where I was!
I should also note that the impractical modifier key combination is possible thanks to using Karibener to change the caps lock behavior. Holding it down is the same as holding down ⌘⇧⌃⌥ and just pushing it once sends and ‘esc’ to the system. I won’t paste links in here, but if you search for “brett terpsra a useful caps lock key” you’ll find the post that will walk you through it.
Hi Tom, thanks for your detailed feedback and tips on how you’re using KM. The switch back action is sweet for how you’re using it. And thanks for reminding me about Karibene. I need to check it out again, it’s been a while since I tried it.
Keep in touch, Tom. It’s always great to read how my blog readers are using Mac automation.
Bakari,
Is it possible to automate the erasure of junk mail in the Mail client for the Mac with Automator? I’d like to schedule that to run every 30 minutes or so but can’t figure out how to get that happen.
Thanks!
Eric, I’m not sure sure about Automator. I will need to see if there’s an action for it. I do know Keyboard Maestro can trigger the menu item to erase junk mail. You can set up an macro to switch to Mail every 30 minutes and KM will trigger the menu item and the OK confirmation. There might also be an AppleScript way of doing it as well. Do a search for AppleScript and erase junk mail to see what you come up with. Let me know if the above helps.