How to Create a Custom Print Workflow to Save Printed PDFs to a Folder Automatically with Automator

For the longest Apple has had AppleScript, which allows you to automate things with your OS and application developers that took advantage of the ways they could open up their programs to AppleScript.  I toyed around with AppleScript way back but it uses what is called “natural language programming” and I don’t like that at all.  For me, it would have been much easier if it was just if, then, else statements instead of guessing what “natural language” phrase they chose to use.  Anyway, with the advent of Mac OS 10.4 Apple released Automator, which allows you to built powerful automations via a graphical drag-and-drop interface.  I’ve created a handful of different workflows that have saved me tons of time.  Here I’ll detail how to make a Print Workflow that shows up in the Print > PDF menu so you can automatically print a pdf that is automatically saved with a filename that includes the date and the first part of the website’s title in a folder you have predetermined.  I use it to save receipts of web-based purchases.

How to Create a Custom Print Workflow to Save Printed PDFs to a Folder Automatically with Automator

Software:

  • Mac OS 10.8
  • Automator 2.3

Step 1: Run Automator.

It’s in the Applications folder of your Macintosh HD or you can just click on the Spotlight magnifying glass icon in the top right of the menu bar and begin to type Automator.

Step 2: Select “Print Plugin.”

If you haven’t used automator before you will get a menu asking you what type of document you want to create.  Click on the “Print Plugin” icon and then click on the “Choose” button.
If you have already used Automator it may open up the last automation you created.  You can just select File > New and it will open up a blank automation with the “Choose a type for your document:” menu.

Step 3: Add “Rename Finder Items” to the Automation.

The first action we’ll need to add will rename the pdf file.  We don’t need to “get” the file (like we would if this was a workflow from scratch) because we chose “Print Plugin” and we get the file by default from the print menu.  Type “Rename Finder Items” in the search box at the top of the second column from the left in the Automator window:
Now click and drag the “Rename Folder Items” action into the window on the right (with the “Drag actions or files here to build your workflow” label in the middle of it.  This will cause a menu to pop up:
This window warns you that it is going to change the name of the file and asks whether you want to make a copy of the file first (via the “Copy Finder Items” action), and then invoke the actions on that copy.  You want to change the original so just click the “Don’t Add” button and this is what you’ll see:

Step 4: Configure the “Rename Finder Items” Action.

The “Add Date or Time” action is chosen by default out of all the “Rename Finder Items” and can be seen in the right window and in it you can see all the different options for how you want to rename the file.  The top left drop-down menu allows you to pick what kind of filename change you want to make (Add Date or Time, Add Text, Change Case, Make Sequential, Replace Text, and Name Single Item).  We want the default for this case, “Add Date or Time.”  For me I want the file named with the date first (YYYY-MM-DD), that way it will show up in chronological order in the finder when I have them alphabetized.  Update: Click the checkbox next to “Use Leading Zeros” so the dates line up in the Finder and sort chronologically (I didn’t figure out this till after I wrote up this pos).  Anyway, here’s the options I chose:

Step 5: Add “Move Finder Items” Action to the workflow.

In the action search box type “move finder items” and click and drag the “Move Finder Items” workflow to the workflow window and drop it below the “Add Date or Time” action.  They will connect automatically and you will get this:

Step 6: Configure the “Move Finder Items” Action.

In this action you will pick the folder you want your pdfs to automatically save.  For me I have a pdf receipts folder with a subfolder for each year.  I created a workflow specifically for this year, 2012.  I’ll have to either edit this or read my blog on how to do it and make another one next year 🙂  Click on the drop-down menu and click on “Other…” and then choose the folder you want your pdfs to automatically save to.  I would leave the “Replace existing files” unchecked because I wouldn’t want to overwrite any previously printed pages.

Step 6: Save/Name Your Print Plugin Workflow.

In the File menu select “Save…” and then name your Print Plugin what you want to show up in the PDF print menu:
Now the next time you print from ANY program on your Mac you will have the option to easily save the document as a pdf to your pre-chosen folder with the date appended to the beginning of the filename with only a couple clicks:
Note: If you are using Google’s Chrome web browser.  Chrome has its own print menu.  You will need to click on “Print using system dialog…” to bring up Apple’s print dialog with the PDF button that has all the Print Workflows listed in it.

Update–Modifying your Print Workflow for the New Year:

When a new year comes around like it has today, you must change the folder your workflow points to and change the name of the menu item.  Here’s how to do that…

Step 1:  Open the Library folder in the Finder.

Switch to the Finder and click on the “Go” menu at the very top of the screen and hold down the “option” key to show the hidden “Library” item.

Step 2: Find the “PDF Services” Folder and find the workflow you previously created.

Macintosh HD > Users > username > Library > PDF Services > workflow-file.workflow

Step 3: Rename the file name to have the current year.

Step 4: Double-click on the workflow file and change the folder it saves the pdf to be the current year.

Change the folder to the new year

El Capitan Update

After I updated to El Capitan my print workflow stopped working.  You would see the gear turning in the menu bar but no file would show up in the designated folder.  I did some searching and found this thread which did not work for me exactly like they suggested but by adding a “dummy” quartz filter at the beginning of the workflow with the filter set to “None” as seen below:

Add a quartz filter to fix the problem
Add a quartz filter to fix the problem

After adding the quartz filter the workflow worked again.

My other Apple Automator blog posts:

Amazon Associate Disclosure: As an Amazon Associate I earn from qualifying purchases. This means if you click on an affiliate link and purchase the item, I will receive an affiliate commission. The price of the item is the same whether it is an affiliate link or not. Regardless, I only recommend products or services I believe will add value to Share Your Repair readers. By using the affiliate links, you are helping support Share Your Repair, and I genuinely appreciate your support.

Written By
More from John Mueller
How to Set Time and Alarms on OK to Wake Childrens Alarm Clock
Our “OK to Wake” alarm clock has been a lifesaver for our...
Read More

Leave a Reply

Your email address will not be published. Required fields are marked *