Advertisement
Tips & Shortcuts

How to Launch Any App with a Keyboard Shortcut

by

Today we're going to rise up and face a challenge that was posed to me recently: how do I assign a keyboard shortcut to launch an app? There's no obvious built-in functionality for achieving this, but with a little ingenuity we can pull it off with very little effort. Read on to find out how.


The Rules

As you're no doubt aware, there are lots of third party Mac apps that we could use to pull this off (such as Apptivate). That's the great thing about being a Mac user, the developer community is always eager to step forward and fill in any gaps in functionality.

The person in question only wanted a single app shortcut and couldn't justify purchasing, downloading and/or installing an app just to make this happen.

That being said, the original challenge, as it was given to me, came with some stipulations. First, no third party utilities were to be used. The person in question only wanted a single app shortcut and couldn't justify purchasing, downloading and/or installing an app just to make this happen.

Further, no complex scripting was to be used. If you keep up on my articles, you know that I'm an AppleScript nerd and would normally turn there right away in this situation. Unfortunately, this person was not familiar or comfortable with scripting, so that option is out too!

Tweetbot
We're going to figure out how to launch Tweebot with a keyboard shortcut.

Admit Defeat? Never!

Admittedly, this sounded like a nearly impossible feat to pull off. The functionality simply isn't in OS X and if I wasn't allowed to turn to AppleScript, what else could I do?

In less than two minutes flat, I had a working solution

Fortunately, I love a good puzzle. In less than two minutes flat, I had a working solution, thanks to the other major automation assistant that ships with OS X: Automator.


Services to the Rescue

I knew that Automator held the key to performing AppleScript-like functionality without the hassle of learning to code. But an Automator action to launch an app wouldn't do me any good on its own, I would still need a way to tie the action to a keyboard shortcut. But how?

System Preferences
The Keyboard Shortcuts pane does us no good.

If we take a look at the "Keyboard Shortcuts" pane in System Preferences, we see only one section where we can add new shortcuts: "Application Shortcuts." This doesn't really help us in any way though, as it only serves as a way to execute a menu command in a currently open app.

All we need to do is create a custom service that launches a specific app, then give it a shortcut here.

While digging around here though, I stumbled on my answer: the Services menu. OS X allows you to assign global shortcuts to any Service. All we need to do is create a custom service that launches a specific app, then give it a shortcut here. Checkmate! Let's see how to pull this off.


Step 1. Set Up an Automator Service

Our first step is to launch Automator and go to File > New. You should see a window pop up that gives you some options for what to create. Click on "Services" and hit the "Choose" button.

Automator
Open Automator and choose "Service"

This will launch a clean slate in Automator where we can construct our workflow. If you've never worked with Services in Automator, don't worry, as with everything else in Automator, they're super easy!

Services are contextual workflows available throughout Mac OS X. They accept text or files from the current application or the Finder.

Step 2. No Input, Any Application

Before we include any actions in our workflow, take a look at the settings near the top of the window, which govern the input for the Service that we're building.

Normally, services are built to take input and do something with them in a given application. Ours will violate this idea though, we don't need anything processed, we just want to launch an app. As a result, make sure you select the options "no input" and "any application."

Automator
No Input, Any Application

Step 3. Include the Launch Application Action

Along the left side of the Automator UI, there should be a column with a bunch of actions. Run a search for "Launch Application" and drag it onto the empty canvas on the right.

Automator
Find the "Launch Application" action

Step 4. Select Your App and Save

Once you drag the "Launch Application" action onto the work area, you should see a little drop down menu that allows you to choose the specific application that you'd like to launch. I'm going to choose Tweetbot, but feel free to select anything you wish.

Automator
Drag in the "Launch Application" action and choose an app

From here, save your Service, name it and close Automator. Almost finished!


Step 5. Assign a Keyboard Shortcut

Back in System Preferences, click on the "Keyboard" pane and go to the "Keyboard Shortcuts" tab. In the left column, select "Services" and in the right column, locate and select your newly created Launch Tweetbot Service (or whatever app you went with).

From here, simply click the "Add Shortcut" button and enter in the shortcut that you'd like to use to bring up that app.

System Preferences
Assign a keyboard shortcut to your new Service

That's all there is to it! Close System Preferences, go back to Finder and hit your shortcut to see if it worked. If you followed along closely, then your app should launch right away.


Finding a Unique Shortcut

The tricky Part about setting up a global shortcut is that you're bound to find that someone else has already hard-coded that shortcut into their app. Your shortcut might work from Finder, but when you launch another app, there could be a conflict.

In my experience, a native app shortcut will override a global Services shortcut.

In my experience, a native app shortcut will override a global Services shortcut. For instance, in my example, I used Option-Shift-Command-T to launch Tweetbot. Unfortunately, Safari uses this for something else, so Tweetbot will not launch from Safari with this shortcut.

My best advice here is trial and error. Try to think of a shortcut that you don't normally use in any application, then try it out for a few days to see if any conflicts arise.


How else could you do it?

There you have it, a quick and easy way to create a keyboard shortcut for launching a specific app: no code writing and no third party apps necessary.

Given this same challenge, how would you pull it off? Can you think of another way to do it? How about if we allow for scripting? Let us know in the comment section below.

Related Posts
  • Computer Skills
    Automation
    Introduction to Automator ServicesAutomator2
    Automator can be intimidating, but it’s a great tool for completing lots of small or large tasks. In this tutorial, I’ll show you how to put Automator to work in contextual and application menus. I’ll create four simple Automator services that can be accessed almost anywhere, and you’ll gain the tools to create services that can do almost anything.Read More…
  • Computer Skills
    OS X
    Improve Workflow by Avoiding the DockDock
    The Dock has been a permanent feature of OS X, however, it's slowly losing relevance as a place from which to access apps. There are more efficient and faster ways to access the programs you need. In this tutorial I show how to ditch the Dock and work smarter.Read More…
  • Computer Skills
    Productivity
    Speeding Up Your Workflow With Custom Trackpad GesturesAccesibility
    In previous tutorials, I've shown you how to speed up your workflow by remapping your underused Caps Lock key, using LaunchBar to launch applications with a keyboard shortcut and using TotalSpaces2 to switch quickly between applications. In this tutorial I will continue with that theme and show you how to use custom trackpad gestures to speed up your workflow.Read More…
  • Computer Skills
    Productivity
    Why a Finder Replacement is Still a Good IdeaFinder2x
    Until OS X Mavericks, a replacement Finder application was a must for most power users. Basic features like tabs were missing from OS X’s default application, so to get an improved Finder experience you had to turn to third parties. With Mavericks, however, Apple has finally brought tabs to Finder. In this tutorial I’ll show you what replacement Finder applications are out there, what they can still add to your workflow and why they're still worth getting.Read More…
  • Computer Skills
    App Training
    Alfred Workflows for BeginnersAlfred400
    Ever since Alfred 2.0 was in beta, I have been making Alfred workflows for myself and for others. It is a lot of fun and very helpful to my daily workflow. I usually average using Alfred around 130 times a day, with my peak day of 768 times. I am going to show you the basic concepts of workflow design in this tutorial, all the way to the very advanced features that you can use in your own workflows in later tutorials. So, come join the fun!Read More…
  • Computer Skills
    Automation
    How to Automate Tasks With ServicesSettings retina
    Services. You see that word everywhere in OS X, but probably don’t know what it means. I didn’t until a few months ago. Essentially, a service is a way of connecting apps to perform special actions. This can be sending a Tweet, sharing a file, or defining a term in Dictionary. There are hundreds of uses for services, but first you need to understand how to use the basic functionality. In this tutorial, I’ll show you how to create your own services, use the ones that are included with some third-party apps, and save yourself a few clicks.Read More…