BINF 6215: Make your first workflow
The first thing we’re going to do in this class is really simple.
To start with, go to your Finder window. Go to the directory Applications: Utilities, find the Grab application, and open it. Use it to capture some screen shots. Make a directory in your Documents folder. Call it something sensible and memorable like “6215-exercises”. Save your screen shots into the 6215-exercises folder.
Next, go to the Applications folder and open the Automator app. Go to the top menu and click “New”. Then create a new workflow.
The first item in your workflow is going to be “Ask for Finder Items”. Find that function in the list, and drag it over to the workflow window. Make sure you set the options to allow multiple selections.
Next, you’re going to change the file format of these images. Drag “Change Type of Images” to the workflow below “Ask for Finder Items”. A dialog will ask you if you want to add a “Copy Files” step to keep a copy of your originals. It’s up to you. What format should you convert to? Remember those screenshots you made with Grab? They get saved from that program in TIFF format, which you can’t (for example) upload into a WordPress blog. So we want to convert them to JPEGs.
Now click the Run button to run the workflow. You’ll be prompted to select files. Select all your screenshot files. The workflow will make a little happy noise when it completes. Save it to your 6215-exercises folder. You never know when you might need to convert some files to a new format.
Congratulations…you’ve made and executed your first workflow!
Now try using these two features: 1) If you convert this workflow into a “folder action” attached to a particular folder, then every image file you add to that folder will be converted to JPG automagically without further action from you. 2) If you convert this workflow into a “service” and save it, you can always access that function from a finder window. Simply select the file and then select “Change to JPG” (or whatever you name your service) in this menu:
Here’s a second little script that you can make that may be useful to you: convert a bunch of PDFs to a single PDF! I use this workflow all the time for building big documents like grant proposals and university curriculum proposals.
You need three pieces:
- Get Specified Finder Items — allows you to choose which files are included in which order, just drag and drop them onto the workflow
- Combine PDF Pages — what it says
- Move Finder Items — moves the finished file into a location you specify (like the Desktop)
The Automator is a funny thing. Most people don’t know it exists, but it has the potential to be really powerful — especially if you start incorporating UNIX shell scripts in Automator processes, which basically lets you tie together your UNIX programs with your Apple applications. But it’s also useful for the kind of boring little tasks that you need to do from time to time — cleaning up old files, converting formats, etc. There are dozens of web pages and forums out there where mac users list their all time favorite workflows and show how they are constructed.