You've seen it in your Launchpad. You've seen it in your Applications folder. It's Automator. It sounds cool. It looks cool. It's got a cool robot icon. But, what can it really do, and why should you care about it?
Well, Automator can do lots of things to improve and streamline your OS X experience. With Automator, you use building blocks called actions like ingredients in a recipe. When your actions are strung together, the result is an Automator workflow that can perform a series of tasks.
Apple provides lots of built-in actions for automating things with Calendar, Mail, Safari, and more. You get even more actions as you install Automator-ready apps, like Aperture, BBEdit, Microsoft Office, and Transmit.
What you can do with Automator depends on the actions installed on your Mac. So, you may run into limitations if you don't have actions for certain tasks, or if an app doesn't support Automator. For simple things like working with folders, images, and PDFs, however, it's a great tool that can save you time and let you do some fun stuff.
In this post, I'll show you how to use Automator to create a print plugin that shows up in the PDF menu when you print a document. This specific plugin lets you print a photo calendar right out of the Calendar app.
In order to print a photo calendar, you're going to need some photos, right? So, open iPhoto and make a new album named Calendar Photos. Find 12 photo files you want to appear in your calendar, and name them in the Finder with the month number and name (01_January, 02_February, etc.). This will make sure they're sorted properly when added to the calendar. Now, import them into iPhoto and add them to the album.
An album of calendar photos in iPhoto
Creating the Workflow
To create your photo calendar Print Plugin, follow the steps below. If you get stuck somewhere along the way, don't worry! You can download a copy of the completed workflow here.
1. Launch Automator (in /Applications).
2. When the template window appears, select Print Plugin and click Choose to create a new workflow.
Creating a Print Plugin in Automator
3. A Print Plugin receives a PDF from OS X's print system for subsequent processing. For this particular workflow, that PDF is calendar pages from the Calendar app. Your workflow needs to do some stuff before it's ready for this PDF, so you need to store a reference to it in a variable. That way you can refer back to it later. In the search field above the workflow's action library, type variable. Select the Set Value of Variable action and drag it over to the workflow area.
Adding the Set Value of Variable action to the workflow
From the action's Variable popup, select New variable... and create a variable named calendar.
Creating a calendar variable to store a reference to the PDF the workflow receives as input
4. Search for the Get Specified iPhoto Items action, and drag it to the workflow area. Click the Add button and choose your Calendar Photos album.
Setting the Get Specified iPhoto Items action to get your Calendar Photos album
Next, with the action still selected in the workflow area, choose Ignore Input from the Action menu in the menu bar. This tells Automator that the action should ignore any info it receives from the previous action. You can tell the action is ignoring input if it no longer appears linked to the previous action.
Setting the Get Specified iPhoto Items action to ignore input
5. Search for the New Folder action and drag it to the workflow area. Set it to create a folder named Calendar Photos on the Desktop. When the workflow runs, this action copies the iPhoto photos in this folder for processing, leaving your originals safe and sound.
Configuring the New Folder action to make a processing folder for your calendar photos
6. Search for the Get Folder Contents action and add it to the end of the workflow. This action gets any images that now reside in the Calendar Photos folder.
This action gets the photo files, so the workflow can process them
7. Find the Pad Images action and drag it to the workflow. Automator displays an alert warning that this action modifies the originals. It suggests adding a Copy Finder Items action first.
Automator usually warns you when an action permanently modifies data
Remember, the New Folder action copies the photos from iPhoto into the Calendar Photos folder on the desktop. So, you're not working with originals at this point. Click the Don't Add button to insert the Pad Images action at the end of the workflow without an additional Copy Finder Items action.
The Pad Images action resizes each image to the proper page size for the calendar. Configure it to set the canvas dimensions to 792 width by 612 height (landscape letter size), and to Scale image before padding.
The Pad Images action makes sure all images in your calendar are the same size
8. Find the Sort Finder Items action and add it to the workflow. To ensure your photos are placed in order, leave it set to sort by name, ascending.
Sorting ensures your images are added to the calendar in order by name
9. Locate the New PDF from Images action and drag it to the workflow. This action combines all calendar photos together as a single PDF, which you'll merge shortly with the calendar pages PDF from the Calendar app. Configure this action to create the PDF on the Desktop, with the output name Photos. Click the Make All Pages the Same Size radio button.
The New PDF from Images action merges your calendar images into a single PDF
10. Time to refer back to that PDF of calendar pages from the Calendar app. Find and add the Get Value of Variable action to the workflow. Choose the "calendar" variable you defined way back at the beginning of the workflow. This action passes both the calendar pages PDF (from the variable) and the images PDF (from the previous action) to the next action for processing.
Automator workflows are linear, but variables let you refer back to earlier data, in this case, the calendar pages PDF received from the Calendar app
11. Find the Combine PDF Pages action, add it to the workflow, and click the Shuffling pages radio button. This action combines the calendar pages PDF and the photos PDF together, interweaving their pages together.
The Combine PDF Pages action combines your calendar pages and photos to form a complete calendar
12. Oddly, the Combine PDF Pages action doesn't let you choose an output folder. Instead, it makes the combined PDF in a hidden folder and gives it a random unique name. So, you need to move it somewhere useful and give it a real name. Find the Move Finder Items action, add it to the workflow, and set it to move the combined PDF to the Desktop.
The calendar PDF is created in a hidden folder, you probably want to move it somewhere useful, like the Desktop
13. Next, add the Rename Finder Items action to the workflow. Again, Automator warns you the action modifies original files and tries to get you to add a Copy Finder Items action first. Click Don't Add to insert the Rename Finder Items action without the additional copy action. From the popup menu at the top left of the action, choose Name Single Item. Then, configure it to set the Basename only to Calendar.
The calendar PDF is created with a random unique name, so its best to rename it to something more readable
14. Finally, you probably want to inspect your beautiful calendar, so go ahead and add an Open Finder Items action to the end of your workflow.
This action opens the completed calendar in your default PDF viewer app, such as Preview or Acrobat
Saving and Running the Workflow
Choose File > Save and save the workflow as Save Photo Calendar. Automator knows where it needs to go (which is into your ~/Library/PDF Services folder) and puts it there.
Saving the Print Plugin with a name that's easy to find in the print system's PDF menu
Next, go to the Calendar app and choose File > Print. In the Print window, set the View to Month and the Paper size to US Letter. Set the time range to start on January of 2013 (or whatever year you want for your calendar) and to end on December of 2013. A text label should indicate that 12 months will be printed. If you want calendar events to appear on the calendar, choose the desired calendars in the list. Finally, check off the options you want to appear on your calendar pages, such as a Mini calendar. When you're done, click Continue.
Calendar gives you lots of options for how calendar pages are printed
When the OS X print window appears, choose Calendar • Save Photo Calendar from the PDF menu in the bottom right.
Print Plugin workflows are run from the PDF menu in the OS X print window
A PDF of calendar pages is printed and passed to the workflow for processing. The workflow runs (give it a few moments to get started). If everything goes according to plan, you should see a photo calendar opened up on your screen shortly.
A Photo calendar printed from the Calendar app
We hope you enjoyed this step-by-step guide -- and that your calendars turned out just as you wanted them!