I have a workflow in Apple’s Shortcuts app for iOS that automates publishing a post from iA Writer (a Markdown text editor) to my WordPress website. Actually, it does more than simplify a tedious task. It allows me to set all the post data in iA Writer with MultiMarkdown metadata, keep my copy locally, and avoid the WordPress editor altogether. iA Writer’s own WordPress feature doesn’t do that (yet?).

I can set a Title (or just use a Markdown header), Category, Tags (converted from iA Writer Twitter-style hashtags to comma-separated WordPress tags), the URL slug based on the filename, a Format, the Status to “Published” (not just the default “Draft”), and a Date (scheduled posts!). It handles Markdown export (WordPress must also be set up to receive it with a plugin like Jetpack) or the default HTML export. I set up my WordPress site to expect the posts and update any post with the same filename, allowing me not just to create new posts but edit existing ones. It all works well and I’ve been using this workflow exclusively for some time.

Except that the shortcut always crashes when I first run it. It succeeds when I immediately run it again. It’s hard to debug because I have to wait some time for it to crash again. I suppose this has something to do with a cache, or the shortcut not having enough memory allotted to it to begin with.

I’ve tried some things to see if I could give it more juice: set up a dummy shortcut that called the longer shortcut, or paused and then called it. I tried to add an action to force the shortcut to run in the Shortcuts app rather than from the Share menu of iA Writer (“Continue Shortcut in App”). I even tried to put various pauses or “Quick Look” actions at the beginning of the shortcut to see where it failed, but it collapses before running even the first action, like Shortcuts sees what’s coming down the line and faints.

I admit the shortcut is long at 150 steps. It is made of up of several stages that were once separate shortcuts chained together, and it would sometimes crash then too. I may have to break it up further, but then it becomes less shareable.

Half the fun is putting a shortcut together. They are not usually one-size-fits-all but connect the dots between a choice of services and apps. Apart from my choices of iA Writer and WordPress, this shortcut isn’t too idiosyncratic. It follows MultiMarkdown and WordPress conventions. You can customize it, of course. I documented it with comments in the shortcut to help others (and my future self).

Do you use iA Writer and WordPress? Try it on and see if it suits. Give some feedback and any ideas about the source of the crash.

Get the iA Writer → WordPress shortcut