Skip to content

Passing Text to Shortcut via Command Line Arguments

  • by
Spread the love


I want to run a Shortcut from the command line and include Unicode text as a part of the command. I want to do something like: shortcuts run "My Notification Shortcut" "My Text Input"

According to the Shortcuts Docs:

Running shortcuts from the command line is no different from running shortcuts in the Shortcuts app—you can pass documents, images, text, and more.

shortcuts -h:
shortcuts run <shortcut-name-or-identifier> [--input-path <input-path> ...] [--output-path <output-path>] [--output-type <output-type>]

This seems to imply that the text must be included as a file. This works:

shortcuts run "Test" -i "/Users/Dave/My Text.txt"

and I want to do this:

shortcuts run "Test" "My Text Input"

Having to save the text to a file seems like an unnecessary step.


Is it possible to pass a text object as a command line arg directly to a Shortcut?

Leave a Reply

Your email address will not be published. Required fields are marked *