Pass input files and capture output from a macOS Shortcuts automation using the shortcuts command-line tool's -i/-o flags

domain: desktop-automation · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Run a shortcut by name from Terminal or a script with `shortcuts run "Combine Images"` (quote or escape names containing spaces)
  2. Feed files into the shortcut with `-i`/`--input-path`, which accepts space-delimited absolute or relative paths or wildcards, e.g. `shortcuts run "Combine Images" -i ~/Desktop/*.jpg`
  3. Capture the shortcut's result to disk with `-o`/`--output-path`, e.g. `shortcuts run "Combine Images" -i ~/Desktop/*.jpg -o ~/Desktop/combined.png`
  4. Control the output's file type explicitly with `--output-type` (a Uniform Type Identifier) when piping output onward instead of writing to a named file
  5. Check the process exit code — `shortcuts` exits `0` on success and `1` on error — to drive branching logic in wrapper scripts
  6. Discover and preview automations before scripting them with `shortcuts list` (optionally `-f <folder>` or `--folders`) and `shortcuts view "Name"`, which opens the shortcut in the editor

Known gotchas

Related routes

Run macOS Shortcuts by name from the command line and pass file input/output using the shortcuts CLI
support.apple.com · 5 steps · unrated
Run a macOS Shortcut non-interactively from a shell script, piping file input and capturing typed output
support.apple.com · 5 steps · unrated
invoke Apple Shortcuts from shell scripts using the shortcuts CLI with input/output file piping
support.apple.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans