Batch Shortcuts Signer (macOS) Shortcut

Social

I’d pretty much given up on figuring out shortcuts --sign until Federico published Shortcut Injector. if you wanted to say... sign every shortcut in your public library, though, doing it one-by-one isn’t ideal. SO, I cautiously modified it to automate the command on all the shortcuts in a given folder. https://routinehub.co/shortcut/11401/


Automate shortcuts sign to export shareable .shortcut files by folder.

Batch Shortcuts Signer
Batch Shortcuts Signer

This is a modification of Federico Viticci’s “Shortcut Injector,,” about which you can read more details in “Creating, Modifying, and Signing Shortcuts on macOS.” While I very much appreciate the craft Shortcut Injector encourages, I definitely do not have the time to move through three whole menu selections for each of the 1600 shortcuts in my library (not that they’re all worth sharing.)

You will need to explicitly set two directories: one for the pre-signed, post-export files saved only because they cannot otherwise be passed to the export tool (most will want to delete these, I assume,) and another to be the final destination of the signed output files. The first is just a Folder action set to Ask Each Time and the second is a simple Text action that represents a pointer originating from your home folder (~).

shortcuts sign -m anyone -i "Pre-Signed Export Path" -o "Signed.shortcut"

I should note that by default, the shortcut comes with a Text Case action designed to transform the input shortcut’s original filename into camel case, mostly because I am 100% fed up with URL-encoded links’ tendency to illicit inexplicable and inconsistent behavior from iOS apps, at least.

That said, please note that said Text Case action is 100% optional. Substitute a Rename File action if you’ d like.

For good measure, here’s the result of shortcuts help sign:

OVERVIEW: Sign a shortcut file.

You can use this command to sign a shortcut file. It also supports signing a shortcut in the old format.

USAGE: shortcuts sign [--mode <mode>] --input <input> --output <output>
shortcuts help --verbose
OPTIONS:
  -m, --mode <mode>       The signing mode. (default: people-who-know-me)
  -i, --input <input>     The shortcut file to sign. 
  -o, --output <output>   Output path for the signed shortcut file. 
  -h, --help              Show help information.

References