How do I print a selected email to PDF using Automator?
You're on the right track, and @mankoff's answer is spot on. I'll elaborate in case you need more details.
For reference, you could read Apple's developer document on PDF workflows or, more simply, this great step-by-step guide to creating the sort of PDF workflow you want.
As a summary...
- First open Automator and create a Print Plugin.
- Then select an action to move your PDF to a folder of your choice.
Save the workflow with a meaningful name. It will automatically be placed in the correct folder (~/Library/PDF Services).
Now, when you are in Mail, you can select your workflow from the PDF menu of the Print dialog box. Your PDF will be generated and automatically filed in the folder you specified.
Make your script and put it in /Library/PDF Services/
or ~Library/PDF Services/
. Then, from anywhere, Print (CMD+P), and select your workflow from the dropdown menu under "PDF".
For example, my workflow takes the name of the file (usually the website name, but sometimes something generic or unhelpful) and appends YYYY-MM-DD-HH-MM.pdf and puts it in the ~/Documents/receipts/ folder.
For this exact same situation I use an app called Keyboard Maestro. I have created an action in there that runs with a hotkey. I have set it up to print the email and save it as a PDF called RENAME_ME.PDF and put inside my dropbox folder. It then opens the folder for me and I rename the file manually. Download my action, add it to Keyboard Maestro and edit the action to use the correct Dropbox path to suit your needs.