I currently have a script that i use in my macmail I would like this script to do more but have no idea how to do it.
I I would like it to do (additional) is save an attachment even if the file name is the same, maybe a -1 or -2 etc. Also I would like the script to provide a count of downloaded attachments and then mark the emails as read and move to a nominated folder.
Here is my current script.
using terms from application "Mail"
on perform mail action with messages The_Messages
set save_Folder to my GetFolderName()
tell application "Mail" to repeat with This_Message in The_Messages
tell contents of This_Message
if (count (mail attachments)) > 0 then
repeat with an_attachment in (get every mail attachment)
set att_save_file to save_Folder & (an_attachment's name)
save an_attachment in att_save_file
end repeat
end if
end tell
end repeat
end perform mail action with messages
end using terms from
--------------
to GetFolderName()
return (path to desktop as text) & "PCPostit:"
end GetFolderName