Workflow for iOS – Publishing Linked Posts to WordPress

· · 11 Comments

I bought Workflow for iOS [App Store] on the day it came out. The app was already amazing back then, but lacked a few features which could help me use it on a daily basis. The most recent update added WordPress support however. It took me a little over thirty minutes to put together a rough workflow for publishing linked posts on Infinite Diaries. I’ve been perfecting that workflow ever since and I’m finally ready to share it with the world.

I divided the workflow into sections, which I’ll explain below. You can find the download link at the bottom of the page. Please note that this workflow is specific to Infinite Diaries and you will have to modify it to work properly on your site (or modify the site itself, which is a bit foolish). Please also note that I’m running custom code to add external links to my posts’ titles both here and in the RSS feed.

‘Publish Linked Post’ Workflow

I run this workflow from Safari or Safari View Controller — it works fine in both. Since I usually post the author’s name as well as short quote from the linked article, I copy the text I want to use before running the workflow. I also add my own comment to the quote, but not every time.

Workflow-Linked-Post-01

  1. Running the workflow on a specific page passes the URL to Workflow.app.
  2. I use the Set Variable macro to save the URL to a variable first — wpURL in this case.
  3. I then use the Get Details of Articles macro to pull the author of the post.
  4. I change the author’s name and surname to lowercase and then capitalise it with title case, mostly to get rid of ALL CAPS and various other strange formatting occurrences.
  5. The next step is an alert, which displays the author’s name. Since the macro from step 3 doesn’t always get it right, I use the dialog box to verify it was correctly retrieved.
  6. I display a menu asking me if I would like to replace the author with a name input manually. If ‘no’ is selected, the macro continues. If ‘yes’, then a windows pops up asking to input the author.
  7. The next steps are divided into Yes and No sections — only one of them is run depending on what is pressed in step 6. The ‘yes’ section asks the user for input and then adds a colon to the end of the author’s name, and then adds that data to the wpBody variable. The ‘no’ section just processes the author’s name again, and then adds it to wpBody.

Workflow-Linked-Post-02

  1. This step takes the saved URL from the wpURL variable and inserts it into the URL macro.
  2. This time I use the Get Details of Articles macro to pull the body of the post in.
  3. A menu is displayed in this step, asking whether I want to use the clipboard (a quote saved from the article before running this workflow) as the quote, or if I would prefer to quote the whole article.
  4. If ‘clipboard’ is chosen, then the Text macro adds the following HTML code to wpBody: <blockquote>(Clipboard variable)</blockquote>. If ‘full post’, then the following code is appended: <blockquote>(Input variable)</blockquote>. The latter means that the full body of the original post is added as a quote. I use this when I want to dissect someone’s complete article.

Workflow-Linked-Post-03

  1. The next step uses the Nothing macro to split the workflow and make sure nothing unexpected is passed to the next action.
  2. I then display a menu, asking if I want to add a comment to the quote.
  3. If ‘yes’ is selected, then a dialog box is displayed with the ability to input text.
  4. If ‘no’ is chosen, then nothing is executed.

Workflow-Linked-Post-04

  1. I use the Nothing macro to split the workflow again.
  2. The next step is to reload the wpURL variable…
  3. … and use it to get the title of the article, again via the Get Details of Article macro.
  4. I then save the original title under the wpTitle variable.
  5. The next step is to run it through Brett Terpstra’s Title Case API, using the URL macro.
  6. Brett’s API returns a result, which is retrieved by Get Contents of URL.
  7. It is then saved to the wpTitle variable, overwriting it.
  8. I ask for input again, to change the title if necessary.
  9. I should probably add an if statement here to only re-run the title through the Title Case API if it’s changed. But I didn’t. The title is re-run through the API and saved under the wpTitle variable once more.

Workflow-Linked-Post-05

  1. The last step of the workflow is to publish it to WordPress. Note: multiple WordPress sites can be added to the Post to WordPress macro.
  2. I first get the wpBody via the Get Variable marco to push it through to the Post to WordPress macro.
  3. I use the wpTitle variable to fill in the title field, change the post format type to Link, set the post’s status to Draft, add the Linked category to it (which I always use for linked posts) and ask to input the tags when the macro is run.
  4. The last step is to add a Custom Field. I use LinkFormatURL in WordPress — the URL from that custom field will be placed as a link under the title of the post.

The whole thing is more complex than it should be, but it fits my workflow and needs almost perfectly. I did cut a few corners in one or two places, and I’ll probably correct that in the future.

In the meantime, feel free to download the workflow and adjust it to your own needs. Hopefully my explanation will make this easier to replicate for others. Also, feel free to ask me questions in the comments below.


Download my ‘Publish Linked Post’ workflow

Chcesz zwrócić mi na coś uwagę lub skomentować? Zapraszam na @morid1n.

11 Comments

  1. Thank you. 🙃🤗❤️
    Dziękuję.

  2. Pingback: Workflow: Powerful Automation Made Simple – iOS – Productivity – €4.99 > €3.99 | Infinite Diaries

  3. Pingback: Daniel Details How to Use Drafts and Workflow for iOS | Infinite Diaries

  4. Pingback: How To Use Workflow For IOS When You Don’t Know Where To Start | Infinite Diaries

  5. i am getting unsuported url when i change to my wordpress account. can you help

  6. Hi great workflow thanks but could you advise on what I would need to change to make the title a url back to the original article? Would be greatly appreciated.

Leave a Reply