Lately I have been looking at some of my Workflows and seeing what ways I can improve them. I've developed 4 workflows that I use on a regular basis, all involving images. I've written about one of them here (Screenshot Stticher). The others involve combining two pictures side by side into one, cropping a photo (usually a screenshot) and then sharing it somewhere, and a quick search of Giphy.
With all of these having the same output, an image, I found myself wanting similar (though not necessarily identical) sharing options between them. I have been toying with the idea of a "Master Output" workflow which would give me options to save, text, tweet, etc the image. Since I don't know of a way to take the Workflow url scheme to pass an image, I was attempting to get around that by copying the image at the end of each workflow, and having the Output's first action be to grab the clipboard. This worked okay but occassionaly seemed to give me inconsistant results. (I'm fully willing to accept it may have been a case of operator error.)
Then it dawned on me that there is a workflow action titled Base64 Encode which I remembered hearing about on a podcast. I don't remember which one specfically, but most likely it was either Connected or Canvas, as I'm pretty sure it was Federico Viticci who was talking about it.
My understanding of Base64 is that it takes an image or file and converts it into a text string. The text string looks like an incredibly long series of gibberish, but that's okay, I don't have to be able to read it since Worklfow can. Because it's text it's now incredibly simple to have the Workflow URL scheme send that as the input for the next workflow.
The first action of my Output is to simply decode the image, and from there I set up various share options. I've modified my Screenshot Stitcher workflow with the new output. You can get it here. At the end of it is the following URL
workflow://run-workflow?name=Output&input=> variable for input
Again, I fully acknowledge there might be a better way, and maybe using the clipboard is it, but with the Base64 method I haven't had any issues with my results. Even better, if I think of a new item I would like to share these finished images too, by changing it in the Output workfow I effectively change it for all of my image workflows.
If you'd like to try the Output workflow out you can get it here
Below you can see the Screen Shot stitcher (left) which leads directly into the Output (right.)