Keyboard shortcuts are the ultimate productivity hack for macOS users. Pressing Command + C is universally faster than moving a mouse, clicking the Edit menu, and selecting Copy. While Apple provides excellent standard shortcuts, many applications bury frequently used tools deep within their menu bars, forcing you to hunt for them repeatedly.
Fortunately, you do not have to rely on the software developer to add a shortcut. macOS includes a powerful, built-in feature that allows you to create custom keyboard shortcuts for absolutely any menu item in any application on your Mac.
In this guide, you will learn how to assign a custom keyboard shortcut to an unmapped menu item, using Apple Safari’s “Export as PDF” function as an example.
Step 1: Identify the Exact Menu Item Name
Before you can create a shortcut, you must know the exact, case-sensitive name of the menu item you want to trigger. macOS is incredibly strict; a single missing space or incorrect capitalisation will cause the shortcut to fail.
- Open the application where you want to create the shortcut (e.g., Safari).
- Click through the top menu bar to find the specific action you want to trigger.
- For this example, click File and look at the option Export as PDF…
- Write down the exact spelling. Crucially, if the menu item ends in an ellipsis (three dots), you must include them. However, they must be the correct type of dots. (Usually, macOS menu items use the single ellipsis character
…rather than three separate full stops.... It is easiest to test both if the shortcut fails).
Step 2: Create the Custom Shortcut in System Settings
Now that you know the exact name of the command, you can map it to a keyboard combination.
- Click the Apple Logo in the top left corner of your screen and select System Settings (or System Preferences on older macOS versions).
- Scroll down the left-hand sidebar and click on Keyboard.
- Click the Keyboard Shortcuts… button located on the right side of the window.
- In the new dialog box, select App Shortcuts from the left-hand list.
- Click the small + (Plus) button below the central box to add a new shortcut.
Step 3: Configure the Application and Trigger
A small configuration window will appear, asking for three pieces of information.
- Application: By default, this is set to “All Applications.” Click the dropdown menu and select the specific app you want to modify (e.g., select Safari). If you leave it as “All Applications,” your shortcut will trigger in any app that happens to have a matching menu item.
- Menu Title: Type the exact name of the menu item you recorded in Step 1. For our example, type exactly:
Export as PDF... - Keyboard Shortcut: Click inside this white text box. Now, physically press the key combination you want to use. For example, press and hold Command + Option + P. The symbols for those keys will appear in the box.
Important Note: Ensure you choose a keyboard combination that is not already in use by the application. If you try to map Command + P, it will conflict with the standard “Print” command and likely fail.
- Click the blue Done button.
Step 4: Test Your New Shortcut
The shortcut is active immediately; you do not need to restart the application or your Mac.
- Switch back to the application (Safari).
- Click on the top menu bar where the item is located (File).
- Look at the Export as PDF… option. You will now see your custom keyboard symbols (e.g.,
⌥ ⌘ P) listed on the right side of the menu item, proving that the operating system has successfully mapped the command. - Click away from the menu to close it, and then physically press your new keyboard shortcut. The “Export as PDF” dialog box should instantly appear.
How to Remove or Change a Custom Shortcut
If you made a mistake, or if the shortcut conflicts with another tool, removing it is simple.
- Return to System Settings > Keyboard > Keyboard Shortcuts > App Shortcuts.
- Find your custom shortcut in the list and click it once to select it.
- To delete it, click the – (Minus) button below the box.
- To change the key combination, simply double-click the shortcut symbols on the right side of the list and press a new key combination on your keyboard.
By mapping your most repetitive tasks to custom keyboard shortcuts, you can drastically speed up your workflow in any macOS application, regardless of whether the developer intended for a shortcut to exist.