Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jtrickett

macrumors newbie
Original poster
Jul 22, 2013
1
0
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.
 
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?
 
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.
 
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.

  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.
 

Attachments

  • Screen Shot 2014-06-28 at 01.26.07.png
    Screen Shot 2014-06-28 at 01.26.07.png
    29.5 KB · Views: 525
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.