I would like to create an Applescript for the Mail application to save a particular email as a PDF document, based on a particular sender. I can set a Rule within the Mail app to trigger based on the sender and then execute the Applescript to save the PDF. However, I'm struggling with the Applescript to save the message as a PDF as I'm new to Applescripting.
Here is the outline of what I think would need to happen:
- Trigger script execution based on sender (through Mail Rule)
- Get date and time for email
- Reformat date to YYYYMMDD
- Set filename as YYYYMMDD - email subject line
- Invoke Print dialog for message
- Set Pages as Range (pages 1 to 2) -- I only need the first two pages of the email saved
- Save as PDF with filename to 'Download' folder
- Move email to Archive Mail folder
- End processing
Any ideas on how to write this script?
Thanks!