single key keyboard shortcut run-or-raise applications
Solution 1:
There's no direct way to map an Application launch to a key command, but it can be achieved without too much difficulty.
To break it down into its components, you need
A Service, which can be key-commanded
An Applescript, to contain the actual launch command
An Automator workflow, to contain the Applescript
The actual key-command.
It might sound hugely long-winded, but it's simpler than building your own .plist
Launch Automator, from Applications
Select New Document, then Service
- On the left, search 'applescript' & drag Run Applescript to the main panel
- Replace
(* Your script goes here *)
withtell Application "Terminal" to activate
Usingactivate
will launch the App if it is not running, or bring it to the front if it already is. [subsequent Services you generate will use each of your desired Apps in this line] - Click at the top where it says 'Untitled' & give it a suitable name. The destination will be already correct for Services.
- Hit Cmd ⌘ S to Save.
At the moment I'm seeing a new behaviour I've not noticed before, under 10.11.6 - Saving isn't automatically installing the service. Closing the Workflow window, then re-opening from File menu > Recent then gives the option to install it. ymmv. - Go to System Prefs > Keyboard > Shortcuts > Services & find your new Automator Service [probably down towards the bottom of the list under General.
Make sure there's a checkmark to the left of it, then click none/add shortcut, to the right & add your F-Key
Make sure your pref in System Prefs > Keyboard > Keyboard is set to use all F1, F2 etc as standard function keys - otherwise you'll have to use Fn/F-key instead.
Rinse & repeat for your other required Applications.
After comments:
Running Services in this way may require Automator to be checked in System Prefs > Security & Privacy > Privacy > Accessibility