Can I create a shortcut to open a specific application on OS X? I want to create a keyboard shortcut to i.e. open Firefox while I am working in another application. I know I can use ⌘ CMD+T when I am in Firefox to open a new tab. 

I haven't found a way to create that kind of shortcuts in System Preferences.

Any ideas?
Karabiner-Elements (10.12 and later)

Karabiner stopped working in 10.12 due to changes in the kernel architecture, and Karabiner was rewritten as Karabiner-Elements which uses a new JSON format for the configuration files.

You can now add a rule like this to karabiner.json (https://pqrs.org/osx/karabiner/json.html):

{
  "from": {
    "key_code": "t",
    "modifiers": {
      "mandatory": [
        "right_option"
      ]
    }
  },
  "to": [
    {
      "shell_command": "open -aterminal"
    }
  ],
  "type": "basic"
}


This makes a short press of the right command key open Emacs:

{
  "from": {
    "key_code": "right_command",
    "modifiers": {
      "optional": [
        "any"
      ]
    }
  },
  "to": [
    {
      "key_code": "right_command",
      "lazy": true
    }
  ],
  "to_if_alone": [
    {
      "shell_command": "open -aemacs"
    }
  ],
  "type": "basic"
}


Karabiner (10.11 and earlier)

Save a file like this as private.xml:

&lt;?xml version="1.0"?&gt;
&lt;root&gt;
  &lt;vkopenurldef&gt;
    &lt;name&gt;KeyCode::VK_OPEN_URL_Safari&lt;/name&gt;
    &lt;url&gt;file:///Applications/Safari.app&lt;/url&gt;
  &lt;/vkopenurldef&gt;
  &lt;vkopenurldef&gt;
    &lt;name&gt;KeyCode::VK_OPEN_URL_iTunes&lt;/name&gt;
    &lt;url&gt;file:///Applications/iTunes.app&lt;/url&gt;
  &lt;/vkopenurldef&gt;
  &lt;vkopenurldef&gt;
    &lt;name&gt;KeyCode::VK_OPEN_URL_EMACS&lt;/name&gt;
    &lt;url&gt;file:///Applications/Emacs.app&lt;/url&gt;
  &lt;/vkopenurldef&gt;
  &lt;item&gt;
    &lt;name&gt;custom&lt;/name&gt;
    &lt;identifier&gt;custom&lt;/identifier&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::F11, KeyCode::VK_OPEN_URL_Safari&lt;/autogen&gt;

    &lt;!-- change the right option key into an extra modifier key --&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::OPTION_R, KeyCode::VK_MODIFIER_EXTRA1&lt;/autogen&gt;

    &lt;autogen&gt;__KeyToKey__ KeyCode::I, ModifierFlag::EXTRA1, KeyCode::VK_OPEN_URL_iTunes&lt;/autogen&gt;

    &lt;!-- make a short press of the right command open Emacs --&gt;
    &lt;autogen&gt;__KeyOverlaidModifier__ KeyCode::COMMAND_R, KeyCode::COMMAND_R, KeyCode::VK_OPEN_URL_EMACS&lt;/autogen&gt;
  &lt;/item&gt;
&lt;/root&gt;


Alfred 2

If you have bought the Powerpack for Alfred 2, you can create a workflow like this:



Hotkeys have a short delay by default, but you can reduce the delay by changing the "Trigger behaviour" option from "Simulate modifier keys released" to "Pass through modifier keys (Fastest)":



Automator services

Open Automator, select "Service" as the type of the document, change "Service receives" from "text" to "no input", add a "Launch Application" action, and save the service. Then assign a keyboard shortcut for the service from "System Preferences > Keyboard > Shortcuts > Services".




I don't recommend this option, because at least on my system, there is at best a delay of around half a second before an application is focused by a keyboard shortcut created using this method, and the delay is often even longer. There has also been a bug since 10.7 where the keyboard shortcuts for Automator services don't always work until you hover over the services menu from the menu bar. (Edit: it's now 8 years after I wrote this answer and the bug still hasn't been fixed.) Also the keyboard shortcuts for services are not available in some applications like Emacs.