Starting application with custom keyboard shortcut
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Beneath the City Looping
--
Chapters
00:00 Starting Application With Custom Keyboard Shortcut
00:24 Accepted Answer Score 14
01:51 Answer 2 Score 2
02:25 Thank you
--
Full question
https://superuser.com/questions/245711/s...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#osxsnowleopard #keyboardshortcuts #hotkeys
#avk47
ACCEPTED ANSWER
Score 14
You have to deal with two issues here
- You can only assign keyboard shortcuts to applications' menu items and services. Terminal.app is neither.
- You cannot usually create a keyboard shortcut using
Esc
for Services in System Preferences » Keyboard » Keyboard Shortcuts.
Make sure a real application launcher such as Quicksilver, Alfred or LaunchBar wouldn't be the better solution.
For a Terminal, have a look at Visor. It allows you to create a HUD console. If you played Quake, you know how it works.
That being said, you can make this work.
First, create a Service by starting /Applications/Automator.app
and select the Service template. Select the Utilities library and double-click Launch Application. Select Other... from the popu-menu and then select /Applications/Utilities/Terminal.app
.
Above the Launch Application command, select no input and any application.
Press Command-S
to save, and name it Launch Terminal.
Now, Open System Preferences » Keyboard » Keyboard Shortcuts, select Application Shortcuts (not Services!). Click the +
button, and select All Applications. As name, type Launch Terminal
. Then, select the keyboard shortcut input field and press Command-Esc
. Click Add.
Done. Now there's a new menu item in Application Menu » Services named Launch Terminal, with the keyboard shortcut Command-Esc
, and selecting it starts Terminal.
ANSWER 2
Score 2
There's a bug where the shortcuts for Automator services don't always work until the services menu has been shown once from the menu bar. And they won't be available in applications that don't have a Services menu. There's also a noticeable delay before they are run.
Using a third party application like Alfred would be a better idea.
You could also assign shortcuts to shell commands like open -a iTunes
.
This would block the script until the application has finished opening, so it would seem to take longer if it was run with FastScripts:
tell application "iTunes"
reopen
activate
end tell