Workflow: Remove Recent Screen Shots09 Jul 2015
The final part of my blogging about Workflow workflows is focussed on tidying up. When I produce the composite screen shot described in the Blogging About Workflows blog post I almost always end up with a small stack of screen shot files sat on my device. Once the final cropped image is produced, I have no further need for them and this workflow is used for deleting them, but it will work stand alone just fine; deleting any screen shots generated in the last twenty minutes.
The workflow begins by capturing any input parameter. Unlike all of the other Workflow blogging process workflows, this workflow makes no use of the clipboard (/ workflow download page link).
Once any input parameter is captured the workflow generates a list of screen shot images produced in the last 20 minutes. The selection is stored in a variable and the number of images counted for verification purposes.
Next the workflow displays a list of options. This could have been accomplished with a Menu action which would have given me a nice structure in which to embed my further actions, but I wanted to have a question appear along with the options (using the Choose from List action) for some verification, so I actually took the ‘longer’ approach on purpose.
When the list is displayed the workflow prompts for automatic or manual deletion of photos and notes the number of photos that will be deleted if automatic deletion is selected. This is my own explicit verification to ensure that I have the correct number of screen shots to be deleted. If automatic selection is selected then the selection of images is passed along, otherwise the workflow presents an option to select exactly what images should be removed. A Delete Photos action is then displayed and a final prompt for deletion is offered.
The last step uses the workflow input to pass control back to another app/workflow. In the case of the blogging process it goes back to the DocFlow workflow. If no input parameter was received then the Open X-Callback URL action will do nothing.
The details of the workflow can be seen below and you can also download this Remove recent Screen Shots workflow.