At the request from : Brian Jones
I wrote an Applescript for a Mail.app Rule that will Automatically Save Attachments in Mail.app .
Each messages attachments from the sender is then placed in a time stamped folder. The time stamp derives from the date received of the message.
I have not put in any code to mark the message as read or processed. But you can do this if you want.
Open script in Applescript Editor
1- Where to save the Script file
Unlike previous Os versions where you could place your Applescript any where in the file system. In 10.8 you need to place Mail.app Applescripts in:
You can simply copy the above path, open a new Finder window.
Hit the keys Cmd + Shift G A sheet will slide down. Past the path in the text field and hit Go.
you will be taken to the folder. Place you Applescript file inside.
The Script will now appear for your selection in the Mail Rules.
2 – Setting your sub folder path for the saved attachment directories and files.
If you wish to change the path of where your attachments folders go. You can make a simple change to the line of code :
set folderName to “Attachments”.
For example I want my attachment folders to go into:
The folderName line will look like this:
set folderName to “documents:mailstuff:mail_Attachments”
Notice the colons (:) they are used instead of the forward slashes (/) to mark directorie separation.
Make sure you do not put a colon at the beginning or at end of your path. They are not needed.
The path to the user home folder is set later on in the line:
set homePath to (path to home folder as text ) as text
So you only need to concern yourself with sub folders of the user home folder.
Another thing to note.
If you only have some of the directories in the folderName path or none at all. The script will create them. It will not over write any folders already existing but will add the missing intermediary ones.
Tested on : Mac Os 10.8.3 , Mail.app Version 6.3 (1503)