I found a script to save a mail attachment and use this with a rule in Mail. How can I adjust the below script to overwrite an existing file?
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 ("MacBookProHD:Dropbox:") & (name of oneAttachment
end repeat
end repeat
end tell
end perform mail action with messages
end using terms from
Thanks in advance