I have an apple script designed, however i need it to do a bit more.
At the moment it downloads attached pdfs and places them in a folder on my desktop. The problem is if i have attachment the same name it overwrites current I need it to NOT overwrite but add.
I would also like this script to set emails as read and move to a folder. Here is the 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
At the moment it downloads attached pdfs and places them in a folder on my desktop. The problem is if i have attachment the same name it overwrites current I need it to NOT overwrite but add.
I would also like this script to set emails as read and move to a folder. Here is the 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