PDA

View Full Version : Automator Save Mail Attachment




jtrickett
Jul 22, 2013, 07:54 AM
I'm looking for some advice for automating a process with Automator/Applescript.

We use electronic paperwork submission for our engineer reports. They come through to by Mail account in PDF format and I am looking for a way to:

1. Rename the PDF replacing "Engineer Report_" for "ER", inserting custom text at the end of the document name and finally inserting the date after the custom text.

2. Allow me to choose the folder where I would like my newly renamed PDF document.

I know this is likely a very simple process however I've tried setting this up as an automator service I can run either from Mail or from Preview and I'm having no joy.



wrldwzrd89
Jul 22, 2013, 11:18 AM
What errors are you getting, if any? Does your Automator workflow work when invoked manually? Are you having trouble setting it up as a service?

aplnub
Jun 27, 2014, 07:36 AM
I help with the part of the first one.

Use "Rename Finder Items: Replace Text" to do the first find and replace.

----------

Within that same box you can "Add Text" after the file-name.

kryten2
Jun 27, 2014, 06:44 PM
I'm looking for some advice for automating a process with Automator/Applescript.

We use electronic paperwork submission for our engineer reports. They come through to by Mail account in PDF format and I am looking for a way to:

1. Rename the PDF replacing "Engineer Report_" for "ER", inserting custom text at the end of the document name and finally inserting the date after the custom text.

2. Allow me to choose the folder where I would like my newly renamed PDF document.

I know this is likely a very simple process however I've tried setting this up as an automator service I can run either from Mail or from Preview and I'm having no joy.

I would go with a Mail rule and Applescript for this however you can try the following workflow as a start.


Get Selected Mail Items or Get Specified Mail Items
Filter Mail Messages
Get Attachments from Mail Messages
Rename Finder Items: Replace Text
Rename Finder Items: Add Text
Rename Finder Items: Add Date or Time


As there is no Mail Messages as input in an Automator Service you can try no input in application Mail with the same actions as listed above.

Note : Every action has an option to Show this action when the workflow runs.