Shortcuts

From IndieWeb
(Redirected from Workflow)


Shortcuts is an iOS app formerly known as Workflow used to automate various actions. With the advanced "Get contents of URL" action it can be used to make Micropub requests or upload files to a media endpoint.

Instagram POSSE

Sebastiaan Andeweg uses Shortcuts to post photo's to his site, and then POSSE them to his Instagram.

A desciption of the (old) flow can be found at Shortcuts/Instagram POSSE

A new, pre-build version can be downloaded. This one makes use of a few other flows. After import, you can customize to your needs.

Note: currently Shortcuts is not able to parse the Location header out of the Micropub request. This means it cannot show you your new post, unless your Micropub endpoint returns the link also in the body. This is non standard, but the Shortcut will detect it and show you your post if it can. If you see your post and want to POSSE to Instagram after it, just return to the Shortcuts app.

IndieAuth

Sebastiaan Andeweg made a Shortcut that does the IndieAuth dance for you, in order to pick up a token. It can be embedded into Micropub workflows, as it returns the token.

The current version required one weird copy-paste step, because iOS is not able to parse attributes after a redirect to the Shortcut app.

You can download the Shortcut here.

Micropub Media Endpoint

Pre-Built Shortcut

You can download a pre-built Shortcut that allows you to upload files to your media endpoint using the Share Sheet, or if the Shortcut is activated outside the share sheet it will present an option to upload from your Photos library or from the Files app.

You can download the Shortcut here

iOS Reminders app Shopping list dictation

Mike Kupietz uses this shortcut to dictate his shopping list and create separate items in his iOS Reminders "Shopping" list. It's based on a technique found on the web long ago, the source is lost to time.

Shopping List shortcut screenshot

So you might run the shortcut, say the phrase "milk and eggs and mayonnaise", and it will add "milk", "eggs", and "mayonnaise" checkbox items to the Shopping list. It's handy for rattling off your shopping list as you're staring into your fridge.

Obviously you need a list called "Shopping" set up in your Reminders app.

This shortcut executes the following steps:

  1. Dictate text - listens for spoken input. Make sure set to stop listening after pause.
  2. Split Dictated Text by Custom and - splits the text into a list with "and" as the delimiter
  3. Repeat with each item in Split Text - begins the loop that adds the items
  4. Add Repeat Item to Shopping with No Alert - adds each item as a separate checkbox line to the "Shopping" list in Reminders.app
  5. End Repeat - ends the repeat loop
  6. Open Shopping - opens the shopping list. Scroll to the bottom to see the newly-added items.

You can download the shortcut from iCloud here. Mike Kupietz created this link from his working copy, but you assume all risk from importing or running code from iCloud.

Creating Your Own Custom Shortcut

Create a new shortcut

  • Accepts: Images, Media
  • What type of shortcut? Action Extension

add the following items:

  • URL: Set the URL to your media endpoint
  • Get Contents of URL: Advanced
    • Method: POST
    • Headers: Authorization: Bearer XXXX (insert a Micropub access token)
    • Request Body: Form
      • file: Shortcut magic variable, choose "Shortcut Input"
  • Show Notification: Contents of URL (This will display the response from your media endpoint so you can confirm the upload worked)

See Also