Jan 30, '08 07:30:02AM • Contributed by: kaih
Sorting through 10,000 emails and manually moving them wasn't my idea of fun -- even on a cold, rainy afternoon. Neither was creating a slew of individual rules for something like If from contains clientname.com then move message to mailbox Client Name. This seemed like a job for AppleScript! As my script-fu isn't as good as I would like it, I've resorted to having a single Sorted folder, and then within that are folders named with the relevant domain name -- eg clientname.com. Here's the script: I then have a single rule in Mail that applies this AppleScript to all incoming emails, and if I've created a folder with the relevant domain name, the emails will automatically end up in there. As it uses a try, if the folder doesn't exist, then the message isn't moved.
I would welcome additions to this script from the MacOSXHints community -- my thoughts to extend it would be to use AppleScript's ability to read plist files, and have a plist file containing clientname.com -> Client Name mappings, and also allow for it to be sorted with finer granularity -- eg, having Friends, Clients, Vendors folders. Such an interface could (relatively) easily be created in AppleScript Studio, and have Mail just call the script to do the heavy lifting.
