Another script to file Mail.app messages by sender
Aug 24, '04 09:21:00AM
Contributed by: pfschill
After seeing this hint and this hint, both regarding filing of received Mail.app messages, neither did exactly what I liked ... so I started with the second one and revised it to meet my needs. This version now supports:
- Optional prompt
- Optional subfolder
- Optional set mailbox to name from Address Book
- Multiple email messages selected
- Support multiple accounts, saves to mailbox on that IMAP account for example
- Automatically create the new mailbox if not prompting user
- Hard coded email aliases (replaced with Address Book lookup)
I didn't want to be prompted each time, so I turned if off but left the code in. I don't use subfolders, so I turned that off (NOTE: I haven't tested using them at all, so it might be broken). The first hint used a shareware library (I think) to look up the full name of the sender from the Address Book. I just call Address Book directly and look it up. This adds a short pause to the script, depending on how many entries are in your Address Book.
This is my first time playing AppleScript, so there might be some stupid things in there but it seems to work for me and does what I want. I haven't done a very good job of commenting how to use it and exactly what it does. Between my five-week old daughter and behind-schedule projects, I am not sure if/when I will get that part done.
[robg adds: Due to the length of the script, I've put the source on macosxhints -- file_mail.txt. I haven't tested this one...]
Comments (10)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20040823043331766