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