Create a Keyboard Shortcut on a Mac: Reaching the App You Open Most
Creating a keyboard shortcut on a Mac is either a thirty second job or an impossible one, and which of the two it is depends entirely on what sits at the other end of the key combination. macOS will happily attach a key to a menu command in any application. It will refuse, by design and in writing, to attach one to the thing most people actually want: opening a specific app or a specific window. Knowing where that line falls is the difference between a working setup and an hour spent in a settings pane that was never going to help.
There are three routes, and they are not alternatives to each other. One binds menu commands. One binds system functions that already exist. One binds anything else, at the cost of building the anything else first.
The limit that decides which route applies
Apple states the constraint plainly in its own documentation for creating shortcuts: keyboard shortcuts can be created only for existing menu commands, and a shortcut cannot be created for a general purpose task such as opening an app.
That sentence eliminates the most common request in this search. There is no field anywhere in System Settings that turns Control-Option-M into a way to launch Mail, because the pane that creates shortcuts works by matching the text of a menu item, and launching an application is not a menu item in any application.
Everything else in this article follows from that one line. If the target is a menu command, use the built-in pane. If the target is a system function, it probably has a row in the pane already. If the target is neither, something has to be built that the system can see as a command, and then a key can be attached to that.
Creating a shortcut for a menu command
This is the supported route, and it is more precise than it first appears.
Open the Apple menu, choose System Settings, click Keyboard in the sidebar, then click Keyboard Shortcuts. Select App Shortcuts on the left and click the add button. Choose the app from the Application pop-up menu, or choose All Applications for a menu command that appears in many apps. If the app is not in the list, choose Other and locate it with the Open dialog. Apple notes that some apps may not allow keyboard shortcuts to be set at all.
The Menu title field is where attempts fail. The text has to match the menu command exactly as it appears in the app, including its punctuation, and two substitutions are required. The arrow between menu levels is typed as ->, and an ellipsis is typed as three periods with no spaces. Apple's own examples are worth copying in form: Format->Font->Ligatures->Use Default reaches the default ligature command in TextEdit, and File->Export as PDF… reaches the export command.
Then click in the Keyboard shortcut field, press the combination, and click Done. Apple's example combination is Control with Option and Z, pressed together. One rule applies to whatever is chosen: a key can be used only once in a key combination.
Two pieces of maintenance are documented alongside it. To change a shortcut, select it, click the key combination, and press a new one. To remove one that was created, select it and click the remove button. The list is legible later, which is a real advantage over remapping a physical key, because the row states the app and the menu command in words.
Most system functions already have a row
Before creating anything, it is worth reading what is already there. The Keyboard Shortcuts panel is divided into categories, and the coverage surprises people who have only ever opened the App Shortcuts section.
The categories include Spotlight, Mission Control, Dock, Display, Screenshots, Input Sources, Services, Accessibility, Keyboard, and a window management section. Inside them sit rows such as Show Spotlight search, Show Finder search window, Show Desktop, Show Apps, Application windows, Exposé, Move left a Space, Move right a Space, Switch to Desktop 1 through Switch to Desktop 16, Turn Stage Manager on or off, Turn Do Not Disturb on or off, Quick Note, and a full set of window tiling entries including Tile Left Half, Tile Right Half and the four quarter positions.
Two of those categories matter for the requests that brought people here. The Keyboard category contains the rows that move focus without the pointer, including Move focus to the menu bar, Move focus to the Dock, Move focus to next window and Move focus to the window toolbar. Several of them have no assigned combination out of the box, so they are not missing features, they are empty fields waiting for a key.
The window management section deserves a separate look for anyone who moves windows by dragging. Every tiling position has a row, so a habit of dragging a window to the left half of the screen can be replaced by a combination that does it exactly the same way every time, with no pointer travel and no near miss. That is the highest return per minute spent in this pane, because window placement is repeated far more often than any single menu command.
The Services category is the door between this pane and the next section, because anything that reaches the Services menu can be given a shortcut here even though it is not part of any app.
Binding a key to something that is not a menu command
The Shortcuts app closes the gap the App Shortcuts pane leaves open, and it does so by turning a task into something macOS can address.
A shortcut built in the Shortcuts app can be given a key combination directly: its details carry an Add Keyboard Shortcut control, alongside options to use it as a Quick Action so it appears in Quick Actions on the Mac, to pin it in the menu bar, and to show it in Spotlight. Shortcuts added to the Services menu appear there as well, which means the same item can also be assigned a combination from the Services category of Keyboard Shortcuts. This is the supported answer to opening an app with a keystroke: the opening is expressed as a shortcut, and the shortcut is what the key reaches.
Three more ways to run the same thing are documented, and they are useful as fallbacks rather than replacements. A shortcut can be run from Spotlight by opening it with Command-Space and typing the name, and Apple notes that pressing Command-3 after opening Spotlight narrows the search to actions. The Shortcuts icon in the Dock can be Control-clicked to reveal a Run Shortcut menu. And a shortcut can be run from Terminal with shortcuts run "Name of Shortcut", with -i or --input-path to pass files in and -o or --output-path to write the result out, which means anything able to run a command can trigger it.
| Route | What it can reach | Where it is set |
|---|---|---|
| App Shortcuts | Any existing menu command, in one app or all apps | Keyboard Shortcuts, App Shortcuts |
| Built-in categories | Spotlight, Mission Control, Dock, Spaces, screenshots, window tiling, focus movement | Keyboard Shortcuts, by category |
| Shortcuts app | Any task that can be built from actions, including opening things | The shortcut's own details, or the Services category |
| Command line | The same shortcuts, triggered by any script or tool | Terminal, with shortcuts run |
One habit keeps this manageable over time. Give related tasks a shared modifier pattern, so that Control with Option and a letter always means a built task rather than an application command. A set of shortcuts that follows a rule is remembered. A set assembled one at a time, each avoiding whatever was free that afternoon, is forgotten within a month and then rediscovered by accident.
Why a brand new shortcut sometimes does nothing
A combination that has been entered correctly and still does nothing is almost always a collision, and Apple documents the behaviour: a new shortcut that already exists for another command or another app does not work, and either the new one or the other one has to change.
That is why reading the existing categories first is not pedantry. A combination that looks free may belong to a Mission Control row, a screenshot row, or an accessibility row that is never used and never noticed. The pane shows all of them, which makes the check a matter of scrolling rather than trial and error.
One collision is worth calling out because it confuses people twice. Apple notes that in some versions of macOS, when multiple input sources are used for typing in different languages, Command-Space and Option-Command-Space change the input source instead of doing what they normally do. The input source rows sit in their own category, named Select the previous input source and Select next source in Input menu, so both halves of that conflict are visible in the same panel.
Modifier choice reduces the risk. Combinations built on Control with Option are sparsely used by the system and by most applications, which is likely why Apple's own documentation reaches for Control with Option and Z as its example.
The shortcut that cannot be created at all
There is one target that defeats every route above, and it accounts for a large share of the repeat searches.
A web service running inside a browser tab has no menu command. It is not an application as far as macOS is concerned, so it cannot be chosen in the Application pop-up menu, and the things inside it cannot be typed into a Menu title field. Two accounts on the same service are one browser to the system. Apple documents that in Safari Command-1 to Command-8 select the first eight tabs and Command-9 selects the last one, so the same keystroke means one thing to the browser and something else to the service loaded inside it, and the service usually loses.
The structural fix is to stop those services being tabs. When each web app holds its own window and its own session, it becomes an application as far as the switcher and the shortcut panes are concerned, its own shortcuts stop competing with tab selection, and the account belonging to one client stays signed in independently of another. The way those separate spaces are arranged is set out in Workspaces, which services are handled that way is listed in Supported apps, and a keyboard driven setup for the whole arrangement is described in Built-in terminal.
What to change first
Open System Settings, Keyboard, Keyboard Shortcuts, and read every category before creating anything, because the row that is wanted often exists with an empty field. Create menu command shortcuts in App Shortcuts using -> between levels and exact menu text, and reach for the Shortcuts app only when the target is not a menu command. If the thing that needs a key is a web service rather than an app, it has to become a window first, which is what a browser like SpaceDeck is for.
Frequently asked questions
Can a keyboard shortcut be created that opens a specific application?
Not through the App Shortcuts pane. Apple states that shortcuts can be created only for existing menu commands and not for general purpose tasks such as opening an app. The supported route is to build a shortcut in the Shortcuts app that performs the opening, then use the Add Keyboard Shortcut control in its details, or assign a combination to it from the Services category of Keyboard Shortcuts.
Why does the new shortcut not appear in the app's menu?
Usually because the Menu title text does not match the menu item exactly. The text has to include the same punctuation as the command, with -> typed for the arrow between menu levels and three periods with no spaces for an ellipsis. Apple also notes that some apps do not allow keyboard shortcuts to be set, in which case no amount of correct typing will produce a result.
How do you find out whether a combination is already taken?
Read the categories in Keyboard Shortcuts, which cover Spotlight, Mission Control, Dock, Display, Screenshots, Input Sources, Services, Accessibility, Keyboard and window management. A combination in use by any of them, including rows that are never pressed, will make a newly created shortcut fail silently, because Apple's documented behaviour for a duplicate is that the new shortcut does not work.
Is it possible to use the same key twice in one combination?
No. Apple states that a key can be used only once in a key combination, so a combination that asks for the same key twice cannot be entered. Combinations are built from distinct modifiers plus one ordinary key, and Control with Option plus a letter is a low collision starting point.
Can a shortcut be triggered by a script instead of a keystroke?
Yes, and it is the same shortcut. A shortcut built in the Shortcuts app can be run from Terminal with shortcuts run "Name of Shortcut", with -i or --input-path for files going in and -o or --output-path for output written to a file. That makes one definition reachable from a key combination, from Spotlight, from the Services menu and from any tool that can run a command.