Automator Save Mail Attachment

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

  1. macrumors newbie

    Joined:
    Jul 22, 2013
    #1
    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. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    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. macrumors member

    Joined:
    Nov 16, 2008
    #3
    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. macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #4
    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