- Joined
- Jan 15, 2011
- Messages
- 6
- Reaction score
- 0
- Points
- 1
- Location
- Sydney, Australia
- Your Mac's Specs
- iMac11,3
I am fairly new to Macs and to AppleScript. I want to automate the download of some mail attachments to a folder in documents. I have found a few scripts that I have tried to implement to no avail. I receive a file which I want to replace in the folder as the latest version, i.e I only want the one version of the file. I have setup a rule to handle it and it supposedly calls the script I have created. Following is the script I am using. If anyone could clarify this for me I would appreciate it.
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with oneMessage in theMessages
set {mail attachment:theAttachments} to oneMessage
repeat with oneAttachment in mail attachments of oneMessage
save oneAttachment in ("Macintosh HDocuments:Users:Michaelocuments:MailAtts:") & ("OpenOrdersLog")
end repeat
end repeat
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with oneMessage in theMessages
set {mail attachment:theAttachments} to oneMessage
repeat with oneAttachment in mail attachments of oneMessage
save oneAttachment in ("Macintosh HDocuments:Users:Michaelocuments:MailAtts:") & ("OpenOrdersLog")
end repeat
end repeat