Tell me more ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I want to create a keyboard shortcut to i.e. open Firefox while I am working in another application. I know I can use ⌘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?

Update : Alfred (wwww.alfredapp.com) allows you to launch any app via a hotkey. You need to buy the powerpack to use this feature.

share|improve this question
1  
So you mean keyboard shortcuts? – Rabarberski Aug 5 '11 at 13:24
Look at the Services on the Application menu any reasonably written Cocoa app will have these and they can be assigned keys. Unfortunately I think Firefox is not written to use these. Safari can be used here – Mark Mar 19 at 12:02

4 Answers

up vote 8 down vote accepted

I'm currently using KeyRemap4MacBook:

<?xml version="1.0"?>
<root>
  <vkopenurldef>
    <name>KeyCode::VK_OPEN_URL_Safari</name>
    <url>file:///Applications/Safari.app</url>
  </vkopenurldef>
  <vkopenurldef>
    <name>KeyCode::VK_OPEN_URL_iTunes</name>
    <url>file:///Applications/iTunes.app</url>
  </vkopenurldef>
  <item>
    <name>test</name>
    <identifier>test</identifier>
    <autogen>__KeyToKey__ KeyCode::CONTROL_R, KeyCode::VK_MODIFIER_EXTRA1</autogen>
    <autogen>__KeyToKey__ KeyCode::F11, KeyCode::VK_OPEN_URL_Safari</autogen>
    <autogen>__KeyToKey__ KeyCode::I, ModifierFlag::EXTRA1, KeyCode::VK_OPEN_URL_iTunes</autogen>
  </item>
</root>

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

Hotkeys have a short delay by default, but you can reduce it by changing the trigger behavior:

Other applications that support assigning shortcuts to opening applications:

Apptivate, BetterTouchTool, Butler, iKey, Keyboard Maestro, KeyLauncher, Keymando, Launch it!, NuKit, Quickeys, Quicksilver, RocketShip, Shortcuts, Spark, Twitch

You could also assign shortcuts to shell commands like open -a TextEdit. open /Applications/TextEdit.app/ doesn't seem to be any faster. The script below is blocked until TextEdit finishes opening, and it raises all windows instead of a single window:

tell application "TextEdit"
    reopen -- open a new default window if there are no open windows
    activate -- make the application frontmost
end tell

Another option would be to use Automator services:

There is a bug in 10.7 and 10.8 where the shortcuts for Automator services don't always work until you hover over the services menu from the menu bar. There is also a small delay before services are run, and shortcuts for services don't work when an application that doesn't have a services menu is frontmost.

share|improve this answer

Get Quicksilver, http://www.blacktree.com/, it will allow you to set keyboard shortcuts to open apps. There are actually more many more apps that do this (Alfred, Keyboard Maestro etc etc.)

Mac OS X actually has a built-in way of doing that, but it doesn't work for Firefox, because it doesn't support services! http://hints.macworld.com/article.php?story=20090903085255430

Update Jan 2012: Blacktree no longer updates Quicksilver--the developer went to Google and has released Google Quick Search Box. Quicksilver lives on, but it has a new home at qsapp.com.

share|improve this answer
Thanks. Was very helpful to me. used Google but didn't find your link. – politicus Aug 4 '11 at 7:41
Cool, so you came right? – Paul Eccles Aug 4 '11 at 11:02
"Yes". Installed Quicksilver (very powerful, certainly better than having just a shortcut). Tried Keyboard Maestro. Now having a rest before learning all these shortcuts ;-) – politicus Aug 4 '11 at 13:41

Alfred

Alfred, in its Power Pack version, can map shortcuts to applications, among many other features.

share|improve this answer

If you do not want to use third party apps.
Then you can use Automator (Services ), and the Built in keyboard shortcuts.

Here is how in an answer to a similar question.

Very simple.

In Step 3, of creating the service.
Set it to 'any application' .

i.e,
set Service receives to: 'no input' in 'any application' (Do this by using the drop downs at the top.)

share|improve this answer
Be nice to know why there is a down vote on this. Not commenting on down votes is not helpful to anyone – markhunte Apr 15 at 16:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.