One shortcut instead of two
Sending a post from an iPhone took two shortcuts until 1.9: one to take the files from the share sheet, one to open the SSH connection. Written on a train walked through both. It is one shortcut now, imported rather than built, and it runs on a Mac as well.
Why there were two
A shortcut started from the share sheet runs in Shortcuts' background runner, whose only screen is a banner. Run Script over SSH needs a screen — the host prompt, the first-run privacy question — and is refused there with "This action could not be run with the current user interface", before any connection is made. The action that used to hand the run over to the full app is no longer offered. A shortcut started from a URL, on the other hand, always runs in the app. So the second shortcut existed only to be started from a URL.
One shortcut, run twice
It does not need to be a second shortcut. The same one runs twice, and tells the two runs apart by the one thing that differs between them: whether it was handed anything.
- From the share sheet, with the post's files as its input, it packs them into one batch, writes the batch to a file in iCloud Drive and opens a URL that names the shortcut itself.
- From that URL, with nothing handed to it, it reads the file back, sends it over SSH, deletes it, and opens the answer on the writing app's page.
A video on the way through is re-encoded to 720p — an iPhone clip of 32.5 MB came out at 5 MB — and a picture goes as it is.
Import it, then fill in what is yours
The shortcut is published signed, so anyone can import it: SendPost. What it cannot know is yours to fill in:
- in Run Script over SSH: the machine you log into, its SSH port, the user, and the path to
scripts/receive.shor the wrapper that reaches it — and a key, whose public half goes on the server; - in the Text that builds the answer's address: your blog's address,
base_urlinconfig/site.yml.
It arrives called SendPost, and its last step opens itself by that name. Rename it and that step has to change with it; a name without spaces saves percent-encoding it.
One warning worth having before anything is edited by hand: Shortcuts reconnects a pasted action's inputs to whatever stands above the place it lands, so an action copied between shortcuts can come back reading from the wrong variable. Importing avoids that entirely.
And on a Mac
The same shortcut runs from Terminal: shortcuts run SendPost. Nothing on the server changed for it — only the phone's side got simpler.
The step-by-step, with a screenshot of the whole shortcut, is in operations.md.

Comments