Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Move Mail messages to named folders via AppleScript Apps
To sort messages in Mail.app when I want, I wrote this script. It gets the senders' email address from the sender of each selected message, matches this to Address Book and looks for a mailbox with the full name as used in Address Book. If succesful, it moves the message.

Adding the script in the hint text is a bit too much, so I put it online for you guys to download here. Please read the page before downloading, as you also need the 24U Appearance OSAX 2.1 library.

[robg adds: The script is too long to easily attach to this hint, so I've also mirrored it in the macosxhints' downloads section: Move to Named Folders [30KB].]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[10,448 views]  

Move Mail messages to named folders via AppleScript | 12 comments | Create New Account
Click here to return to the 'Move Mail messages to named folders via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
24U Appearance OSAX 2.1 doesn't appear to be free
Authored by: jecwobble on May 26, '04 10:30:07AM

Your installation instructions on your download page say that 2.1 is free. The 24U website says it's shareware that costs $18/$36 depending on the license you buy.

Now v1.3 for Classic is free, though, but I suspect will not work for this hint.



[ Reply to This | # ]
24U Appearance OSAX 2.1 doesn't appear to be free
Authored by: gadg on May 26, '04 05:12:58PM

I think you only pay this if you want to package their lib with your scripts. As I chose not to do this, I think it's free for everyone to download. I haven't paid for it. Perhaps I should anyway ...

---
the difference between men and boys, is the price of their toys



[ Reply to This | # ]
24U Appearance OSAX 2.1 doesn't appear to be free
Authored by: gadg on May 31, '04 07:36:17AM

You're absolutely right. I never read the licensing terms, but my testing license expired earlier. Seems like I will have to buy a license. The script will function, even after the testing license has expired.

---
the difference between men and boys, is the price of their toys



[ Reply to This | # ]
Move Mail messages to named folders via AppleScript
Authored by: k_187 on May 26, '04 10:38:14AM

Couldn't you do the same thing with a few rules in Mail.app itself? Using applescript is nifty and all, but this seems like a lot of extra work.

---
k187 blogging goodness: http://k187.blogspot.com



[ Reply to This | # ]
Move Mail messages to named folders via AppleScript
Authored by: ghoppe on May 26, '04 11:40:02AM

I thought the same thing at first. I guess the advantage this script has is that you don't have to go through the process of making new rules -- you just make a new mailbox and the script does its thing.

I could see how some people might find that useful...



[ Reply to This | # ]
Not auto-filtering...
Authored by: MattHaffner on May 26, '04 02:59:35PM

The advantage here is that this is not filtering all incoming e-mail to boxes. Rather, all new mail goes to your INBOX and then you can select a whole bunch of messages after you've read them and it will auto-file them for you. This is more along the lines I like to work (and have for many years). I have too many folders to do any auto-filtering of anything but what I can safely ignore for a week or so (which, like you say is what Rules are good for).

I don't know if this is the root of this particular submission, but the unix mail reader Pine (others might do this too, but more of you might be familiar with it) has done this kind of thing for a long time. In addition, it has the ability to file your Sent e-mail based on the To: header so that conversations with individuals are kept in their respective folders. It was real nice to go back 2 years and read the whole conversation back and forth by scanning a few messages in the same folder.

Unfortunately, I've migrate somewhat from the per-individual folder to a more topic-based system over the last few years, although I wish I had time to organize it even further. It takes more time to file things since it's not particularly suitable for scripting/auto-filing (which is why my non-spam INBOX hovers between 100-200 too often), but I find it much easier to find things later on a particular topic.

Really, what we need (as I think has been said before elsewhere) is something like smart playlists for e-mail with the ability to very easily add tags (before or after sending/receiving) or such to e-mail headers so that you can set up virtual folders that catch topics (authors, recipients, all messages with PDF attachments, etc.) automatically. Evolution had (has?) some of this functionality, but when I looked at it long ago it was entirely dependent on the static state the mail came in with. We need the ability for the end user (recipient) to attach categories/tags/whatever (and multiple ones if they want) to a message--just like you can do with your MP3's and photos now.

And *please*, Apple, (like anyone there will actually read this anyway...) *PLEASE* don't add some straightjacket system like the Finder's 7 label colors. Give us the ability to have many, many categories. Appearance modification can be limited, but let it be a separate 'filter', not a part of the tag system.

And that's more than my 2ยข.



[ Reply to This | # ]
Not auto-filtering...
Authored by: gadg on May 26, '04 05:24:54PM

You got it right, the organising by sender is how I archive my email. Mind you, I do this for personal email only. At work I organize topic-based, but I use Outlook@Windows there. Organizing personal email by topic doesn't work properly if you ask me. But your suggestion for easily adding categories or whatever is a much wanted feature for Mail.app.

---
the difference between men and boys, is the price of their toys



[ Reply to This | # ]
Not auto-filtering...
Authored by: MattHaffner on May 27, '04 11:32:02AM

I agree with your division between work and home. I have a few topic based personal discussion folders for friends, but not many. I'd envision 'smart' folders to allow you to match on any header so you could mix and match individual and topic based folders.

Of course, while we're pipe dreaming, it would be great if you could organize the 'smart' folders hierarchically. I would actually like to be able to do this for iTunes playlists and iPhoto galleries, actually... The tricky thing is whether the physical storage of the messages is just one monolithic folder/file or if there is still some traditional IMAP based folder structure underneath that you also control or Mail.app controls on it's own behind the scenes. Hmmm... fun to muse about...



[ Reply to This | # ]
Smart Mailboxes
Authored by: gadg on May 28, '04 08:46:51AM
Well, do you really care how it's stored? The way information is displayed and the way information is stored very often has nothing to do with eachother. For instance, only because our harddisks are supplied with a file allocation table can we find information on them. The bytes are stored in one long 'line', or actually 'everywhere' (which is what the defragmenting apps fix for us) ...

So I guess if such Smart Mailboxes existed, we could just make a structure of folders we think suits our individual needs. And Mail.app could just leave all messages in one big mailbox for all I care. I'll leave it to those amazing Apple programmers to figure out how to deal with a mailbox several GB in size :-)

Hmm, perhaps I should download Zoe and see what that is all about. This seems to address at least part of our needs. Check it out at http://www.zoe.nu/. Let me know what you think via a personal message (does this forum allow personal messages? i dunno...)

For those who are wondering why creating mailboxes and Smart Mailboxes is not the same: sometimes you want to look at data from several angles; for instance: sorted by sender, or by subject, or by date, or by domainname, or by mailclient, or by attachments. The way we look at data changes constantly. What Matt and I (and many others) are going on about is facilitating this constant change without copying email messages to 15 different folders everytime one arrives.

---
the difference between men and boys, is the price of their toys

[ Reply to This | # ]

Move Mail messages to named folders via AppleScript
Authored by: mchang on May 26, '04 12:54:38PM

I submitted a similar hint that moves emails based on the part of the string before the '@' symbol in the From: field.

http://www.macosxhints.com/article.php?story=20040419052354599&query=mail+applescript

Working on a new and improved version, FYI.



[ Reply to This | # ]
Move Mail messages to named folders via AppleScript
Authored by: gadg on May 26, '04 05:15:47PM

Yeah, I noticed your script. It does not check the Address Book though, which is one of the main issues for me writing this script. Your script was very helpful though, I should mention you in the credits :-)

---
the difference between men and boys, is the price of their toys



[ Reply to This | # ]
I did something similar
Authored by: Diggory on May 27, '04 09:56:54AM

I wrote something similar for my own use a while ago.

I found that people often don't have their full name in email messages - or had an differing names for different email accounts they have. So I wrote a little application that maintains a set rules in mail - on a per-person basis, and updates the rules whenever the app runs.

this means you have to run the app every time someone changes their email address - but it's easier than doing it all by hand.

you can find the app here: RuleBox. (please excuse the poor UI - I wasn't expecting to release it really.)

---
*****
monkeyfood software - http://www.monkeyfood.com

[ Reply to This | # ]