I’ve done some Googling on this but all the articles I found are quite old.
I’d like to set up a Mail rule that saves specific emails as PDF’s and I thought Apple Script would be a good way to do this.
Does anyone know what script I could use to save a selected email (from the mail rule) as a PDF to my downloads folder? (I’ll then use Hazel to sort the PDF accordingly)
Mail.app does not have a scriptable interface for writing an email message to a PDF. The only way to do so is via the menu item (also accessible as noted with a keyboard shortcut).
You can AppleScript this by tell’ing System Events to control the user interface (you can get the same effect with the menu control actions in Keyboard Maestro).
Although I have done this, I have found it to be difficult to rely on in practice due to timing delays. Sometimes the save to PDF is fast; sometimes it will hang for a while. In addition, you need to do further UI scripting if you want to designate the file name for the saved email and its location, all of which add up to this being a rather inefficient and frustrating process.
What you are saying is that using AppleScript to manipulate the menus is hokey, and I agree. It would be better to use some intermediate program (as @Dougee implied), preferably a free one. I wasn’t able to identify a candidate.