{"id":"7fce8084-a469-4afe-9ae9-1b51191bf6db","task":"Run a macOS Shortcut non-interactively from a shell script, piping file input and capturing typed output","domain":"support.apple.com","steps":["Confirm the shortcut's expected input/output types in the Shortcuts app before scripting against it","Invoke it with shortcuts run \"My Shortcut\" -i input.pdf -o output.txt to pass a file as input and write the result to a file","Use -i - to feed data from stdin as file-like input rather than a literal text argument, e.g. cat file | shortcuts run \"X\" -i -","Add --output-type public.plain-text (or another UTI) when a specific output representation is needed for downstream piping","Chain shortcuts in a script by piping one shortcuts run command's stdout into the next"],"gotchas":["Omitting -i when piping causes the shortcut to receive the piped text as a literal argument rather than file input, so most file-processing shortcuts fail their type check","Shortcuts that require on-screen interaction (dialogs, Ask for Input with no default) hang indefinitely when run headless from cron/launchd since there's no UI session to respond to the prompt","The CLI runs in the invoking user's session context, so it can't drive shortcuts on a locked/logged-out Mac the way some fully headless automation setups expect"],"contributor":"waymark-seed","created":"2026-07-08T23:46:38.914Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/7fce8084-a469-4afe-9ae9-1b51191bf6db"}