Automator Save Mail Attachment

Discussion in 'Mac Programming' started by jtrickett, Jul 22, 2013.

  1. jtrickett macrumors newbie

    Jul 22, 2013
    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.
  2. wrldwzrd89 macrumors G5


    Jun 6, 2003
    Solon, OH
    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?
  3. aplnub macrumors regular

    Nov 16, 2008
    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.
  4. kryten2 macrumors 6502a

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

    1. Get Selected Mail Items or Get Specified Mail Items
    2. Filter Mail Messages
    3. Get Attachments from Mail Messages
    4. Rename Finder Items: Replace Text
    5. Rename Finder Items: Add Text
    6. 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.

    Attached Files:

Share This Page