applescript to move email attachments

i am new to mac and have no clue how to make a script


i want to have all my email attachments from one sender go to a folder on my network drive and automaticly print all pdf's any help would be greatly appreciated

MacBook Air, iOS 7.1

Posted on Mar 25, 2014 9:01 PM

Reply
17 replies

Oct 16, 2015 12:39 AM in response to markgbb

I'm trying to get this to work on El Capitain. The Mail Rule i have set up works, this is proven by flagging the mail. Unfortunately i cannot get the attachments saved. I have tried different folder locations but didn't succedd. Can anyone have a look on the script i'm using? Might there be someone to help me through remote desktop connection? I would pay for the service. Best Oliver


using terms from application "Mail"

on perform mail action with messagestheMessages

set attachmentsFolder to "Volumes:Macintosh HD:Users:oliveremmler:Desktop:WorkOrders:" as rich text

tell application "Mail"

set selectedMessages to theMessages

try

repeat with theMessage in selectedMessages

set counter to 1 -- added

repeat with theAttachment in theMessage'smail attachments

set subjectText to (get theMessage'ssubject) as rich text

set originalName to ((every word of subjectText) as rich text)

set savePath to attachmentsFolder & originalName & (counter as rich text) --modified

set counter to counter + 1 -- added


savetheAttachmentinfilesavePath

end repeat

end repeat

end try

end tell

end perform mail action with messages

end using terms from

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

applescript to move email attachments

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.