Switch Apps on MacOS Using Keyboard Shortcuts
Disclaimer
Do this at your own risk. I’m not responsible if your stuff breaks. You’ll be allowing Automator to control your computer. If you have weird automations you can potentially create security holes in your computer. Again, I’m in no way responsible if you do any of that. This is just a what I did to make something work.
Let’s get to it then
This morning I came across the duckyPad and almost made an impulsive buy. It looked really cool and had a ton of functionality, but I have the Moonlander which is a really nice keyboard and realized it could do what I wanted.
My goal was to be able to switch between Slack, IntelliJ and iTerm on MacOS with at most two keys per app. I could have alt + tabbed through open apps to get to each application, but that’s too much work. Here’s what I did to switch between apps using keyboard shortcuts and the Moonlander -
Create an automation to launch the app you need
- Go to Automator
- Make a New Document
- Select Quick Action
- Select no input from the Workflow receives current dropdown
- On the left side pane, search for Launch Application
- Drag and drop it into your workflow (the large grey area)
- Select the application you need from the dropdown
- Save it and give it a name
Add a keyboard shortcut to run the quick action
- Go to System Preferences -> Keyboard -> Shortcuts
- Select Services
- Scroll all the way to the bottom until you find the action you just created
- Add a unique keyboard shortcut for it
Allow apps to control your computer
- MacOS does not easily allow apps to control your computer
- Go to System Preferences -> Security and Privacy -> Accessibility
- Unlock and add Automator to the list
- PS: You’re allowing Automator to control your computer. Please make sure you are okay with it
Add the keyboard shortcut to your Moonlander/Ergodox using the configuration tool
- You know how ;-)
Profit!
If the application has not launched, it will be launched by the automation. If it is already running, MacOS will switch to the application.