November 16, 2026
How to create custom keyboard shortcuts on Mac
Open System Settings, Keyboard, Keyboard Shortcuts, App Shortcuts, click the plus and type the exact name of a menu command. That gives any command that sits in a menu its own keys. For the rest (open an app, run a script, a key that changes per app) macOS has no setting, and one line in a hotkey file does it.
The built in way: App Shortcuts
- Open System Settings, click Keyboard, then Keyboard Shortcuts.
- Select App Shortcuts and click the plus.
- Choose the app, or All Applications.
- Type the command exactly as its menu shows it, for example
Export as PDF…. For a command in a submenu write the path,File->Export as PDF…. - Click the shortcut field, press your keys, click Done.
Where it goes wrong:
- The name has to match to the letter. Three dots in a menu are one character, type it with Option and semicolon.
- Keys that another command already uses do nothing until you change one of the two.
- Only commands in the menu bar count. A button in a window has no menu name.
What App Shortcuts cannot do
| You want | App Shortcuts |
|---|---|
| A menu command on new keys | Yes |
| Open an app or bring it to the front | No |
| Run a shell command or a script | No |
| Send a keystroke to the app | No |
| One key with a different job in each app | Menu commands only, one entry per app |
| A mouse button as a shortcut | No |
Everything else: a key and what it does, one per line
Hotkeys keeps your shortcuts in one text file. A line is the keys, a space, and the action. ^ is Control, ! Option, * Shift, # Command.
// Control Option C opens Chrome from any app
^!c runApp("Google Chrome")
// Control Option D opens the Downloads folder
^!d open ~/Downloads
// Option S shows the page source, only in Chrome
!s if currentAppChrome() sendKeys("command-option-u")
// F5 reloads in Chrome, gets new mail in Mail, opens Chrome anywhere else
f5
if currentAppChrome() sendKeys("command-r")
else if currentApp("com.apple.mail") sendKeys("command-shift-n")
else runApp("Google Chrome")
- Download Hotkeys, or run
brew install --cask hotkeys-app/tap/hotkeys. - Open it and switch it on under System Settings, Privacy & Security, Accessibility when macOS asks.
- Click its icon in the menu bar and choose Edit config.
- Add your lines, save, then choose Reload in the same menu.
A line with a typo is skipped and named with its line number, the other lines keep working.
Every shortcut in one text file, a key per line. The first 50 hotkeys are free.
What it is not
There is no window to click shortcuts into, the file is the interface. Saving alone changes nothing, you reload. It needs macOS 14 or later. Without a license the first 50 hotkeys of the file load, with no time limit.
For keys that launch apps see how to open an app with a keyboard shortcut.
Apple's pages on this: create keyboard shortcuts for apps, Mac keyboard shortcuts.
Questions
Why does my custom shortcut not work?
Most often the menu name does not match, check capitals and the three dots. The second cause is a clash with keys the app or macOS already uses.
Can I make a keyboard shortcut that opens an app?
Not in System Settings. The Shortcuts app can, and so can a hotkey file with one line per app.
How do I change a shortcut macOS already has?
Open System Settings, Keyboard, Keyboard Shortcuts, pick the group on the left, double-click the keys next to the command and press the new ones.
Can one key do different things in different apps?
Yes with a hotkey file, an if in front of the action names the app. App Shortcuts can only give the same keys to one menu command per app.
Every shortcut in one text file, a key per line. The first 50 hotkeys are free.