Sub topic 8
Running shortcuts from the menu bar, Dock, Finder and the keyboard
A shortcut is only useful if you can start it quickly. This chapter covers the main ways to run one on a Mac, how each method passes input, and what goes wrong most often. It assumes you can build a multi-step shortcut and know what Shortcut Input is, from the earlier chapters on actions, variables and receiving content. Menu names can differ slightly between macOS versions. If a label here doesn't match what you see, look for the closest wording in the shortcut's Details pane.
The working model: one shortcut, many entry points
A shortcut is stored once in your library. Each launch method is a different way to start that same shortcut. The method decides two things:
- Whether input arrives. Some methods hand the shortcut files or text. Others start it with nothing.
- Where it runs. Most methods run it in the background. Opening it in the editor lets you watch each step.
The diagram shows a rule you will use throughout this chapter. Launchers you click or type (menu bar, Dock, hotkey) usually start a shortcut with no input. Launchers tied to a selection (Quick Actions, Services) pass that selection in as Shortcut Input.
Running from the Shortcuts app
The simplest way to run a shortcut is to open the Shortcuts app and do one of these:
- Double-click a shortcut in the library, or click its play button.
- Open it in the editor and click the Run button (the triangle) at the top right.
Running from the editor shows each action's progress and results as it executes. Running from the library tile runs it more quietly. Use the editor while you are building, and use the other methods below for daily use.
Pinning to the menu bar
The menu bar gives you a list of shortcuts from any app.
- Open the shortcut in the editor.
- Click the Details button (the info icon) in the right-hand sidebar.
- Turn on Pin in Menu Bar.
A Shortcuts icon appears in the menu bar. Click it and the pinned shortcuts are listed. Clicking one runs it.
Some things to know:
- Only pinned shortcuts show up here. Unpinned shortcuts are not listed.
- The shortcut starts with no input. If it relies on Shortcut Input, add an If check or an Ask for Input fallback so it doesn't fail on empty input.
- Shortcuts that show a prompt or a result appear as a dialog from the menu bar. This works, but a long chain of prompts can feel awkward from the menu bar. Keep menu bar shortcuts short.
Adding to the Dock
You can put a shortcut in the Dock so it behaves like an app icon. In the Shortcuts library, select the shortcut and choose File > Add to Dock. (Right-clicking the shortcut may also offer this.) A Dock item appears with the shortcut's icon and name. Clicking it runs the shortcut.
Points to check:
- The Dock item takes its name and icon from the shortcut. If you rename the shortcut later, the Dock item may still use the old name, so create it again if it looks stale.
- Like the menu bar, a Dock launch passes no input.
- Dragging a file onto the Dock item is not a reliable way to pass input. Use a Quick Action for file input instead.
Finder Quick Actions
Quick Actions run a shortcut on files you have selected in Finder. This is the best fit when your shortcut processes files.
- Open the shortcut and show the Details pane.
- Turn on Use as Quick Action.
- Enable Finder (and, if offered, Services Menu).
- Set what the shortcut accepts, such as Files, Images or Folders.
Then select files in Finder, right-click, and look under Quick Actions. You can also use the Finder menu bar item Finder > Services or the Quick Actions buttons in the Finder preview pane (View > Show Preview).
The selected files arrive as Shortcut Input. A shortcut that previously worked from the editor must now handle that input correctly. For example, a Run Shell Script action set to pass input as arguments receives the file paths:
for f in "$@"; do
wc -c < "$f"
doneThis prints the byte size of each selected file. The quotes around "$f" matter. Without them, any filename containing a space is split into separate words and the command fails.
Controlling what the Quick Action accepts
The input types you choose decide when the Quick Action appears. If you only tick Images, the action will not show up when you select a PDF. Choose types deliberately:
| Accepted type | Appears when you select | Typical use |
|---|---|---|
| Files | Any file | Renaming, copying, size reports |
| Images | Image files | Resizing, converting formats |
| Folders | Folders | Archiving, counting contents |
| Text | Selected text in an app (Services) | Reformatting, searching |
If you accept too many types, the action appears in places where it makes no sense. If you accept too few, you may think it is missing.
Enabling and ordering Quick Actions
macOS also controls which Quick Actions are visible. Open System Settings > Privacy & Security > Extensions (on some versions, Login Items & Extensions) and look for the Finder extensions. Make sure your Quick Actions are ticked. You can drag them to change their order in the menu.
Services menu and text input
The Services Menu option adds your shortcut to the Services submenu of the application menu in many apps. If you select text in a document and run the shortcut from there, the selected text is the Shortcut Input.
This works well with the text-transformation shortcut from earlier chapters. A Run Shell Script action with input passed to stdin can convert selected text:
tr '[:lower:]' '[:upper:]'Not every app exposes Services. If your shortcut is missing in an app, try the same selection in TextEdit or Notes to confirm the shortcut itself works.
Keyboard shortcuts
A keyboard shortcut gives the fastest launch. In the Details pane, click Add Keyboard Shortcut and press the key combination you want.
Guidelines:
- Include at least one modifier key (Command, Control or Option), usually two or more. A bare letter key is not accepted.
- Avoid combinations that apps or macOS already use, such as Command-C or Command-Space. A clash can cause the other function to win, or both to fail.
- Shortcuts of this kind can run while you are in other apps. A shortcut assigned to a combination that the frontmost app also uses may be intercepted by that app.
- A keyboard launch passes no input. If the shortcut needs a file or text, have it use Get Clipboard or Ask for Input, or use Quick Actions instead.
A common pattern is a hotkey shortcut that reads the clipboard. You copy text, press the key combination, and the shortcut does its work on the clipboard contents. This gets you hotkey speed without needing Shortcut Input.
Other ways to start a shortcut
You may also run shortcuts from Spotlight (type the shortcut's name), from Siri by saying the name, or from the Terminal. Terminal use is covered in a later chapter. Automations, which run a shortcut on a trigger without you doing anything, are also covered separately.
Choosing the right launcher
| Situation | Best launcher | Why |
|---|---|---|
| Processes selected files | Finder Quick Action | Selection becomes input |
| Processes selected text | Services menu | Selected text becomes input |
| One-click utility, no input | Menu bar | Always visible |
| Launch like an app | Dock | Familiar icon and click |
| Used many times a day | Keyboard shortcut | No pointer movement |
You can enable several methods on one shortcut at the same time. Keep in mind that the same shortcut must cope with each one's input, including the empty case.
Making one shortcut work everywhere
A shortcut that is launched from several places will sometimes get input and sometimes not. Use an If action on Shortcut Input with the condition has any value. In the Otherwise branch, use Ask for Input or Choose from Menu to get the content another way. This avoids writing a separate shortcut per launcher.
Common errors
- Quick Action is missing. Check input types, the Finder checkbox, and the System Settings extension list.
- Runs from the editor but fails from Finder. The editor run had no Shortcut Input, or it had different input. Test from Finder with a real file.
- Hotkey does nothing. Another app or system function uses the same combination. Pick another.
- Menu bar item not listed. The shortcut is not pinned, or the Shortcuts menu bar item is hidden. Check the Details pane and the Shortcuts app settings.
- Spaces in file names break a script. Quote variables as
"$f"in shell scripts.
Exercise
You built a shortcut that resizes images, and you want to run it on several selected files in Finder. You pinned it to the menu bar, but it fails because it receives no images. Which launch method should you set up instead, which input type should you accept, and what does that change about how the shortcut receives its images?
Show answer
Use a Finder Quick Action: open the Details pane, turn on Use as Quick Action, enable Finder, and accept Images (or Files). The selected files then arrive as Shortcut Input, so the shortcut no longer needs to ask for them. The menu bar launch passes no input, which is why it failed.
Exercise
A teammate assigns the keyboard shortcut Command-C to their shortcut and finds that copying behaves oddly. Why did this happen, and what rule should they follow when choosing a combination?
Show answer
Command-C is already used by macOS and apps for copying, so the two uses clash. They should choose a combination that includes modifier keys (such as Control and Option together with a letter) and that no app or system function already uses.