Run shell script
Choose zsh, bash or sh and write the script in the step. Save output as keeps what it printed for the steps after: sort the selected lines with sort, then paste them back.

Feature Free
Shell scripts, AppleScript and Apple Shortcuts on a key, with your selection passed in.

At a glance
For what the interface doesn't expose. A git command, a transform of the selection, a setting with no menu item. Most shortcuts never need one.
Your selection comes along. The selected text, the clipboard and every value saved earlier arrive as SUPER_ variables, and what the script prints can be pasted back.
Scoped like any shortcut. Super key + D runs the deploy script in the terminal and the formatter in your editor.
One step among others. Open the app, run the script, paste its output where the cursor is.
Choose zsh, bash or sh and write the script in the step. Save output as keeps what it printed for the steps after: sort the selected lines with sort, then paste them back.

Same shape, AppleScript instead of a shell. Save result as keeps the script’s last value. A script that drives another app asks for its Automation permission once.

Pick any shortcut installed in Apple’s Shortcuts app. The step runs it, waits, and can hand it text with your values filled in.

How it works
Click New Shortcut, choose Start blank, pick the key, then Add a step and choose Run shell script.
Choose zsh, bash or sh. $SUPER_SELECTION is the selected text, $SUPER_CLIPBOARD the clipboard.
Set Save output as to a name, and a later step can paste it.
Free on every plan.
Download for macOS →The built-in route is Automator or the Shortcuts app: a Run Shell Script action inside a Quick Action, given a keyboard shortcut in System Settings, with no clean way to pass the selection in. In Super Shortcuts, Run shell script is a step: pick the key, choose the shell, write the script, and the clipboard, selection and saved values are there as environment variables.
The script runs from your home folder with no login or dotfiles, with /opt/homebrew/bin and /usr/local/bin on its path. $SUPER_CLIPBOARD and $SUPER_SELECTION are set when the script names them, and one $SUPER_NAME per value saved earlier. Send it text feeds a value to standard input. Save output as keeps what the script prints, up to 1 MB, for the steps after it.
The step fails when the script exits non-zero, with its error output as the message, or runs past Give up after, 30 seconds unless you change it. Escape stops it. A process you mean to leave running must send its output elsewhere, or the step waits for it.
Yes. Run Apple Shortcut searches the shortcuts installed on your Mac, runs the one you pick and waits for it to finish. More options can send it text, values included. It remembers the shortcut's identity, so renaming it later doesn't break the step.
Usually not. Menu items, buttons, keys, text, apps, websites and windows are all plain steps. Scripts are for what the app's interface doesn't expose: a git command, a transform of the clipboard, a system setting with no menu item.
Free on every plan. Your shortcuts run on your Mac.
Not ready yet? The occasional update, no spam.
More features
FreeEvery Step a Shortcut Can RunEvery step a shortcut can run. Twenty-one of them, all free.
FreeThe Super Key: One Key for All Your Mac ShortcutsHold one key you already own and every other key does a job you chose.
FreeOpen Apps and Websites With One Key on MacSafari on Super key + 1, Slack on 2, VS Code on 3. One press and the app comes forward.