shortcuts - macOS


Overview

shortcuts is a command-line tool for managing and launching Automator workflows and AppleScripts. It provides a convenient way to quickly access and execute these tasks from the Terminal or scripts.

Syntax

shortcuts [options] <workflow_name> [arguments]

Options/Flags

  • -h, –help: Displays the help message.
  • -l, –list: Lists all available Automator workflows and AppleScripts.
  • –import: Imports a file containing an Automator workflow or AppleScript (JSON format).
  • –export: Exports the specified workflow or script to a file (JSON format).
  • –run-as: Specifies the user to run the workflow or script as.

Examples

Launch a Workflow:

shortcuts MyWorkflow

Launch a Script with Arguments:

shortcuts MyScript --argument1 value1 --argument2 value2

Import a Workflow:

shortcuts --import path/to/workflow.json

Common Issues

  • Workflow or script not found: Ensure that the specified name is correct and that the file exists.
  • Permission denied: Check that you have the necessary permissions to run the workflow or script.

Integration

Combine with Other Commands:

ls -l | shortcuts MyWorkflow

Execute Scripts from Strings:

result=$(shortcuts MyScript)
  • automaton: Manage and execute Automator workflows graphically.
  • osascript: Execute AppleScripts directly.