What steps do I need to run a command line program via a global shortcut?
I setup Automator to create a new Run Shell Script and tried to assign a shortcut in System Preferences -> Keyboard -> Keyboard Shortcuts, but nothing happened.
|
|
Applescript it:
Oh, and I don't know about assigning an shortcut through System Preferences |
|||||||||||
|
|
FastScripts includes all scripts in ~/Library/Scripts/, so you don't have to add files manually. It also supports application-specific scripts.
Other applications that can be used to assign shortcuts for running scripts:
You can also create an Automator service:
There's a bug in 10.7 and 10.8 where the shortcuts for services don't always work until the services menu has been shown from the menu bar. Shortcuts for services don't work when the frontmost application doesn't have a menu bar or a services menu. There's also a short delay before services are run. |
||||
|
|
Without knowing the specifics of what you are looking for, I'd suggest creating a new Service through Automator. Services can be bound to keystroke triggers, and can execute shell scripts (among other things).
|
|||
|
|
|
Quicksilver can be used to bind hotkeys to actions.
If it's a Unix command or shell script you want to execute, this Stackoverflow post gives some more information on using Quicksilver's "Terminal module". |
||||
|
|
|
It appears as though this was available in 10.6, (see http://hints.macworld.com/article.php?story=20090903085255430) but something broke in 10.7.2 (and possibly earlier 10.7) I have found though that the Services keyboard shortcut is honoured when System Preferences is at the forefront, but not in any other application, including Finder. However, the earlier suggestion to use Spark worked perfectly in lion, except that I couldn't use Ctrl in my keyboard shortcut. (not a showstopper!) |
|||||
|