Automating Posts on macOS

Post to Writeas Blog

A setup for posting to blogs directly using Siri Shortcuts, the CLI, and (optionally) Drafts for Mac.

Though there is currently a desktop application in the works for macOS and the web editor is certainly no slouch, I thought I'd attempt to take advantage of my newfound knowledge of the CLI, Drafts Actions, and Siri Shortcuts on macOS to manifest one of my all-time dream integrations: publishing directly to with Drafts.

To start – assuming you already have the CLI installed – lets run writeas help post in our shell:


For my own use, I really needed to consider just two arguments, here: which blog I'm posting to and in which format. Since my blog's CSS overwrites all but monospace, I always publish in --sans. Keeping this in mind, I allotted for these two options in my Siri Shortcut as customizations set on install.


Now, whenever it's run, my shortcut will be running this command: write-as post -c chaff --font sans plus whatever input I've given it. By default, it will grab from the clipboard, but I'm going to use a custom Drafts action to send input, instead.


Very simply, this action simply calls a shortcut entitled “Post to Blog (macOS)” sending the [[safe_title]] of the Draft as the markdown title followed by a space and then the draft's [[body]].


#software #automation #configuration