Revisiting Workflow's IFTTT Functionality

Although Workflow’s recently added support for API interaction, it’s already been possible to create workflows that interact with many online services already, albeit in a more basic way. Back in June, Workflow added support for IFTTT, a web automation service that makes it simple to connect hundreds of different services to each other.

IFTTT functionality within Workflow is something that I feel is too easily overlooked. I rarely see any workflows that make use of this integration, and even I don’t make much use of it. In fact, the only workflow at Workflow Directory that uses IFTTT is one that I wrote to demonstrate its functionality–a workflow that triggers an IFTTT recipe to call your phone and get you out of an awkward situation.

Workflow’s API support opens up so many possible uses but it can get really complicated very quickly. It’s worth keeping in mind that some of the functionality you’re looking to achieve could be done much more easily with IFTTT1. After spending some time exploring what’s possible, I’ve created some examples of IFTTT-powered workflows that demonstrate the usefulness of this action.

Post to Medium

Only a handful of iOS apps support posting to Medium, each of which has slightly different limitations or requirements. Using Workflow, it’s possible to send Markdown-formatted text from almost any app and post it to Medium. Thanks to IFTTT’s extensive Medium support, it’s also possible to specify tags, publication ID, and even a canonical URL if you’re cross-posting a piece you’ve published somewhere already. Interestingly, IFTTT’s support for Medium is actually better than most iOS apps that provide some sort of Medium integration.

This workflow, used as an action extension with any Markdown-formatted text, uses this IFTTT recipe to create a published post on Medium. The workflow prompts for a title, tags, and canonical URL (if required) during the process before it’s published. If you prefer, you can edit the recipe so that the post is unlisted or also added to a publication.

If you edit the recipe to have IFTTT create a draft post instead, tags are not included and need to be added when you edit the draft.

Create GitHub issue

I’ve covered using the GitHub API in Workflow before, but you don’t need to start delving into that if you just want an easy way to create GitHub issues. Using this workflow and IFTTT recipe, you can create an issue within the GitHub repository you specify. There’s also provides an option to include a photo or screenshot when creating the issue. To accommodate this, the workflow uploads it to Dropbox and gets a direct link to use within the issue description.

Creating a GitHub issue using Workflow and IFTTT

Subscribe to RSS feed in NewsBlur

This workflow makes me wish I had spent more time looking into Workflow’s support of IFTTT. I’d been looking into the NewsBlur API to create a workflow that subscribes to a site I provide, but this is something that I can do just by using IFTTT. This workflow makes use of this recipe and detects the RSS feed of a website, then passes it to NewsBlur to subscribe to.

  1. There might even be services that you want to make use of which don’t have a public API but are available through IFTTT.

Using Workflow to Perform OCR

Microsoft’s Cognitive Services (née Project Oxford) is an interesting collection of APIs that leverage machine learning to determine useful information about any provided data. One useful example of the APIs available is the Computer Vision API. It offers OCR functionality that detects any readable text within an image and outputs the results as plain text. Thanks to Workflow’s new API support, we can harness the power of machine learning to perform some very quick, and very accurate, text recognition.

This workflow prompts you to either select a photo or take one with the camera, then uses it to make an appropriate API request. The detected text is returned back and displayed as plain text that can be easily shared or copied to the clipboard.

OCR of a Notes screenshot OCR of a photo taken of a page in a book

Cool, right? Well it gets even better. The Computer Vision API can OCR images containing text in different languages so Workflow can also translate the detected text into our chosen language. The workflow includes a Translate Text action so you can try this for yourself.

After the OCR process, text can be translated within Workflow

This is really useful, especially when traveling. For instance, if you’re on vacation and are wondering what a street sign means, just run this workflow and take a photo, and you’ll get a translated version of the text.

Similar to other API services, an API key is needed to authenticate your requests. Just register for the service and copy/paste the appropriate subscription key for Computer Vision. There are also some size limits (both file and resolution) you need to consider so I recommend reading through the relevant documentation.

Workflow and APIs

In what is most certainly an early Christmas present for people like myself, Workflow has just received one if its most significant updates-extensive support for making API requests. I can’t emphasize enough how useful this is and the impact it’s going to have when it comes to iOS automation.

Workflow’s “Get Contents of URL” action has been overhauled to provide support for GET, POST and PUT request methods, including custom header information. The action also features an easy-to-use way of creating a request body that handles the formatting and escaping of values automatically. This opens your workflows up to all kinds of interactions with many APIs, such as Stripe or GitHub.

To demonstrate just how powerful this revamped action can be, I’ve created a few example workflows that leverage some popular APIs. These examples don’t perform any sort of error handling, nor do they represent what the limits of Workflow are. Consider these workflows a starting point for building your own.

A word about API keys

Keep them secret, keep them safe.
– Gandalf the Grey hat

Interacting with an API almost always requires some sort of API key or token. This is usually a string of random characters that can be used to directly perform actions on behalf of your account. If someone were to obtain this, they can not only access your account information but also perform actions on your behalf.

If you create a workflow that you want to share, make sure to remove your API key from it beforehand!

GitHub: Create Gist

This is a workflow I’ve always wanted to create, and the new API support makes it possible. Gists are great to share small pieces of text information, such as code snippets or scripts. This action extension workflow accepts files of any type (though they must be text-based) and creates a gist using the GitHub API.

You need to create a GitHub personal access token before you can use this workflow. GitHub allows you to create multiple access tokens with different permissions. For the purpose of this workflow, I recommend creating a token that can only be used to work with gists.

Stripe: Get Recent Charges

Stripe is a payments platform that’s built for developers. This workflow retrieves some basic information about the last three charges processed on your Stripe account, such as:

  • Charge ID
  • Amount
  • Last four digits of the card used

To use this workflow yourself, include your test or live secret API key, depending on whether you want to retrieve test or live payment information.

Stripe: Create a Payment

This is an excellent demonstration of Workflow’s API support–use Workflow as a point-of-sale device! This workflow prompts you to enter credit card information and an amount to charge, along with some additional information, then creates a payment.

Create a payment on Stripe using Workflow

A notification is displayed once the payment has been processed and a link to the payment in your Stripe Dashboard is copied to the clipboard.

A payment created with Workflow

Stripe: Create a Customer

Moving on from creating payments, this workflow creates a customer object using the information you provide. A link to the customer object in your Stripe Dashboard is also copied to the clipboard.

Digital Ocean: Create Droplet

Digital Ocean is a cloud computing platform that makes it easy to deploy a server (droplet) in just a few seconds. Using its API, this workflow creates a new droplet using the information provided, such as the Linux distribution, how much RAM it should have, and the datacenter location.

Digital Ocean: Get Droplets Info

This workflow simply retrieves a list of all your current droplets and provides the following information for each:

  • Name
  • ID
  • IP address
  • Status

Some Photos Taken With an iPhone 7

I only received my iPhone 7 yesterday so I’ve not been able to put the camera through its paces, though the few shots I’ve managed to take so far have been magnificent. The quality certainly isn’t close to my DxO One, but the iPhone 7 is far superior to my previous 6s Plus—especially in low-light conditions.

The first two photos, hosted at 500px, were edited using a combination of Photoshop Express, Pixelmator, and Snapseed1. While these have been edited, no attempts at noise reduction were made with the night shot of Manhattan. I’m very impressed with how well the iPhone 7 performs in low-light conditions.

The last photo, posted on Instagram, is unedited and unfiltered.

Manhattan Nights by Jordan Merrick on

It's a dog's life! by Jordan Merrick on

  1. I’ve been editing photos entirely within iOS, using apps like these, ever since iCloud Photo Library was first made available. I can’t even remember the last time I opened Photos on my Mac, let alone edited a photo with it.

Upgrading an AirPort Extreme's USB Hard Drive Used for Time Machine

There are two Macs in our home using Time Machine to back up to a 1TB USB hard drive connected an AirPort Extreme 802.11ac. After the painful process of changing the country of my iTunes Store account when I moved to the US, I was forced to keep a local copy of all the movies and TV shows I had purchased. This is backed up as well, so the 1TB drive began to run out of space.

The drive would soon need to be replaced with something bigger, so I purchased a 2TB Seagate Expansion portable hard drive. However, I didn’t want to just swap the drive connected to the AirPort Extreme and start backing up the Macs from scratch–I wanted to retain the existing backup history1. The AirPort Extreme’s Time Machine support has had a spotty history so I was a little wary about whether it was even possible to even do.

After a search online didn’t yield any meaningful results, I decided to wing it and see if I could just plug both drives into my Mac. Turns out, this works perfectly. Here’s what I did:

  1. Make sure both the USB disk attached to the AirPort Extreme was not mounted on either Mac
  2. Disconnect the USB drive from the AirPort Extreme
  3. Connected the new USB drive to the Mac and created a single HFS+ volume named Time Machine (this is the same name as the existing USB drive)
  4. Connected the old USB drive to the Mac, then copied the disk images to the new drive

Both drives, along with my MacBook Pro, are equipped with USB 3.0, so I left the Mac for a few hours to copy 800GB between the drives while I ran some errands. Once this was finished, I then connected the new USB drive to the AirPort Extreme and restarted the base station2.

After the AirPort Extreme powered back up, I started a Time Machine backup on my Mac. The backup worked flawlessly, creating an incremental backup and not, as Time Machine does when it thinks something is amiss, start an entirely new one. I could also view, and restore from, any part of the Time Machine backup history.

  1. I also had plans to use the outgoing 1TB drive for something else.

  2. I don’t think restarting the base station was necessary but it was worth doing, just to be on the safe side.

The DxO One

I’ve owned a variery of cameras over the last ten years, from bulky DSLRs like the Nikon D50 to the much more pocketable Sony NEX-3N, but I’ve never enjoyed carrying a separate camera around. It was always another device to carry, something else to remember to bring. For the last couple of years, the only camera I’ve been using is an iPhone.

After moving to the U.S. earlier this year, I’ve been tempted by the thought of a dedicated camera to take better shots than the iPhone is capable of, especially in low light. However, I still didn’t want something else to carry. With that in mind, I decided to purchase the $479 DxO One after reading some favorable reviews.

DxO One

DxO One

The DxO One isn’t like any other digital camera–it has a built-in Lightning connector and is designed as a a companion for the iPhone or iPad. Since most of the typical camera functions are offloaded to the iOS device and companion app, the unit itself is extremely small and feels more like a tiny battery pack than a fully-fledged camera.

When the camera is connected to an iPhone using the Lightning connector, the appearance of the two is reminiscent of one of the first digital cameras from Casio. It can also pivot around 60 degrees in either direction. The DxO One has a 1-Inch 20.2MP sensor, the same one found in the popular Sony RX100 III, and a 32mm equivalent fixed lens with a maximum aperture of f/1.8. There’s full support for PASM modes, and the camera even shoots RAW. There’s even microSD card slot to save these to, though JPEGs are automatically synced to the iPhone1.

After using the DxO One for a week, I’ve been completely blown away with the quality of the shots it produces, especially in low light. It even works with a Bluetooth remote camera button I bought for less than $20 to use with my iPhone, so long exposures are super-easy to perform. Here are a few examples from my 500px gallery, edited using Adobe Photoshop Express (click through to view more detailed information about the camera settings for each photo):

Lower Manhattan by Jordan Merrick on

Lazy dog! by Jordan Merrick on

Jersey City streets at night by Jordan Merrick on

Happy dog! by Jordan Merrick on

The DxO One certainly isn’t cheap and there are many point and shoot cameras that offer more functionality for less money. There’s no optical zoom and it’s video recording capabilities are overshadowed by the 4K support the iPhone offers. But there’s no other camera that works as seamlessly with the iPhone as this. The DxO One’s portability, ease of use, and regular feature updates makes it one of the best cameras I’ve ever had2, and it’s perfect for my needs. It’s so small and light that there’s never a question about whether I want take it somewhere–it just comes with me.

DxO have recently announced a range of new accessories for the DxO One, such as a waterproof casing and optical adapter, further expanding its functionality. If you use an iPhone and want to take higher quality photos but, like me, don’t want to carry a whole other camera around, I urge you to check out the DxO One.

  1. Now that iOS 10 supports RAW photo editing, I’m hoping that a future update to the DxO app will allow for syncing of RAW photos as well.

  2. The DxO One will gain full Wi-Fi connectivity in a few weeks so it can be used with its companion app without needing to be physically connected.

Castro 2 →

A superb podcast app from the fine folks at Supertop. I loved the original version of Castro, and the new version’s Inbox / Queue / Archive feature sounds fantastic. I often find myself swamped with too many new episodes that I know I’ll just never listen to, so being able to cherry pick the ones I want to catch up on is perfect for me.

Hyper →

An app that describes itself as HyperCard for the modern age, Hyper is an organizational tool for iOS, macOS, and Apple TV. It just launched and is in public beta, and I’ve been very impressed with what it can do so far.

“Stacks” can be shared with other users within the app, or on the web in a read-only fashion. The developer has even created an API to export data in a variety of formats (which I’m already considering building some workflows for). Users can also post comments and ratings (if you use these) so it’s shaping up to be a decent collaborative tool for small groups.

The demo Foodr stack is a good example of what this app can do, but I encourage you to play around and see what you can create.

Hyper is brand new so it’s a little rough around the edges and doesn’t support a wide range of block formats. Considering it’s an app that only just launched, there’s a lot of promise. This is one app I’ll be keeping my eye on.

(Via Hacker News).

Watermarking Images With Workflow

Although Workflow doesn’t currently have a built-in action specifically for watermarking, there are a couple of ways to accomplish this with just a little preparation.

Using the Edit Image action

Workflow has a capable image editor built-in already, powered by Aviary, which is invoked using the Edit Image action. There’s a text tool within Aviary that provides control over the placement and style of text in an image. The only drawback is that the text cannot be automatically specified–it has to be entered each time.

A workaround is to include a Text action with the text to use, then have Workflow copy it to the clipboard before the rest of the workflow Is run, as shown in this example workflow. All you then need to do is paste it into the editor’s text input field.

This method works great if you just need to occasionally watermark an image. If you want to fully automate the process and/or work with multiple images, there is a better solution.

Using the Overlay Image action

It’s possible to create a workflow that can automate the entire process of adding a watermark to images using the Overlay Image action, a more recent addition to Workflow’s collection1. This particular action is very customizable, providing options for the dimensions, location and angle of the overlaid image2.

Although Workflow cannot generate an image file from text, we can just create one in advance and use it within the workflow. I created a watermark in Pixelmator and saved it as a transparent PNG (delete the background layer before exporting). I recommend making the canvas size (and text) suitably large, around 2000-3000px wide, so that it can be used in images of all different sizes (Workflow will resize the image down accordingly).

With a watermark already created, it’s simply a matter of overlaying the watermark onto the target image. At this point, we could use the Overlay Image action’s option of Show Image Editor and manually drag and resize the watermark, but we can do better than this. Instead, Workflow can get the height of the target image, then set the size of the watermark to a proportional height.

In this example workflow, I’ve specified that the watermark be placed on the lower-left, at a height of 10% of the target image. The width is automatically scaled, and the opacity is set to 90%. The watermark is stored in the /Workflow directory on iCloud Drive, as workflow.png.

The entire process is fully autonomous and works with multiple images. You could take this workflow even further and include options for selecting whether a black or white text overlay should be used, as well as varying the angle and location of the text (if you prefer a full-size diagonally-placed watermark, for example).

  1. This action was added to Workflow 1.4.4.

  2. It basically made my Screenshot Builder workflow obsolete.

SCK 0.3 Now Available →

I’ve released a minor update to the Stripe Checkout for Kirby plugin that adds an option to specify a default charge amount and description that can be used to place SCK anywhere on your site, and have the same amount be used to create a charge. This is something I originally created for Workflow Directory to add a “Tip Jar” button site-wide, without having to specify an amount on every single page it would appear on.

The plugin is available from GitHub, either by cloning the repository or downloading a ZIP of the latest release.