To pass selected text into a Mac shortcut, enable the shortcut as a Quick Action or show it in the Share Sheet, then run it from the app where you selected the text. Shortcuts adds an input step at the start of the workflow; use that input in the next action. The app must be able to share the selection, and the shortcut must accept text. Apple’s Mac guide documents both ways to run a shortcut with content from another app.

Set up the shortcut to accept text

Open Shortcuts on your Mac and create a shortcut, or open one you want to adapt. Double-click it to open the editor, then open Details. Select Use as Quick Action to make it available in supported app contexts, or select Show in Share Sheet to run it through an app’s Share button. Apple says enabling either option adds an input action at the beginning of the workflow, where you can set the content types the shortcut accepts. If you choose the Share Sheet for the first time, macOS may also require permission for the Shortcuts sharing extension. Apple: Run a shortcut while working on your Mac

Click the input type in that first action and allow Text. Choose Rich Text as well if the material may include formatting and your next action supports it. Apple distinguishes plain text from rich text, which can include formatting from webpages or text editors. If you leave the input set to Any, the shortcut may appear in more sharing contexts than you need; restricting it to text types can keep it relevant to text selections. Apple: Understanding input types in Shortcuts on Mac

Use the selected text in the workflow

Add the action that should work on the selection after the input action. In that action’s input field, insert the input variable from the first action—often shown as a Magic Variable—rather than assuming the text will be supplied automatically to every action. For example, a shortcut could receive selected text and pass it into an action that accepts text. The exact next action depends on what you want to do with the text and which actions are available on your Mac.

Decide what the shortcut should do when it runs without input. In the input action, Apple documents options such as Stop and Respond, Ask For, Get Clipboard, and Continue. For a shortcut whose purpose depends on a selection, stopping with a short message or asking for text avoids proceeding with an empty input. Get Clipboard is a separate fallback: it uses clipboard contents, which may differ from the text currently selected. Apple: Limit the input for a shortcut when run from another app on Mac

Run it from the Mac app

Select the text in the source app. To use the Share Sheet, click the app’s Share button, choose Shortcuts, select your shortcut, and click Done. To use a Quick Action, open the app’s supported Quick Actions or Services menu and choose the shortcut if it appears there. Apple also documents assigning a keyboard shortcut to run a shortcut, but the reliable way to pass the current selection is to launch it from an app context that supplies the selected content; a keyboard trigger alone does not guarantee that an app will provide its selection. Apple: Run a shortcut while working on your Mac

If the shortcut is missing or receives no text

First check that text is allowed in the input action and that the source app exposes the selection through its Share button or Quick Action/Services options. Apple notes that a shortcut may be absent from the Share Sheet when the app has no appropriate content to pass. A shortcut launched from places such as the Dock may receive no initial input, so test it from the source app with text selected. If the app does not expose selected text to these system features, the documented setup cannot force it to do so; use the app’s own copy/share controls or another supported route to provide the text. Apple: Run a shortcut while working on your Mac, Apple: Limit the input for a shortcut when run from another app on Mac

The key check is whether the shortcut’s first input action receives the selected text when launched from the source app. Configure accepted text types, connect that input to the action that needs it, and choose an explicit response for runs without a selection. Availability depends on what the app supplies to macOS.

Sources