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

Automate rule creation based on sender in Mail Apps
What I wanted: To ease the creation of rules to filter incoming messages based on the sender in Mail.app. So I wrote this AppleScript to accomplish that objective.

Copy and paste the script into Script Editor, and save the script. Here's how to use it:
  1. Select a message in Mail.app.
  2. Call this script (either via the Script menu, or via a hotkey...)
  3. Choose a name for the folder in which you want to keep messages from this sender
That's it; you're done -- the rule will apply to incoming messages. The folder will be automatically created if it does not exist. Here's another method, which allows better selection of the destination folder (and IMAP folders, too):
  1. Move any message from the sender you wish to filter into any folder.
  2. Select this message.
  3. Call the script.
  4. The script realizes that we are in a folder which is not the In Box. It then gives you the choice to use the current folder, or to use another one.
[robg adds: I haven't tested this one.]
    •    
  • Currently 2.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[6,715 views]  

Automate rule creation based on sender in Mail | 8 comments | Create New Account
Click here to return to the 'Automate rule creation based on sender in Mail' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automate rule creation based on sender in Mail
Authored by: mozart11 on Jun 22, '05 12:20:21PM

Can't save the script in the editor. I get an error of Syntax Error : "Expected "then", etc. but found unknown token."



[ Reply to This | # ]
Automate rule creation based on sender in Mail
Authored by: Zonker1967 on Aug 17, '06 07:50:45AM

I've only just now seen your message, but I think I know what the problem is.

I think the ? should be either a "not equals" sign (≠).

When I make this change, the script can be compiled. Now, I'm trying to use it.



[ Reply to This | # ]
Automate rule creation based on sender in Mail
Authored by: designbot on Jun 22, '05 01:02:48PM

I honestly don't understand what some people are thinking when they make these hints. How do these get on the front page? An AppleScript? What is wrong with you people?

1. Mail > Preferences… > Rules > Add Rule

2. If From Contains xxx@xxx.com, Move Message to mailbox xxx.

Is that too complicated? Oy.



[ Reply to This | # ]
Automate rule creation based on sender in Mail
Authored by: jmontana on Jun 22, '05 01:20:38PM

The whole point of AppleScript is to automate repetitive behavior. If you really prefer four mouseclicks and a lot of typing, then by all means use the standard method. I think this script will save me a lot of annoyance.



[ Reply to This | # ]
Automate rule creation based on sender in Mail
Authored by: designbot on Jun 23, '05 03:26:29PM

So, then the clicks and keystrokes associated with downloading the script, opening it in Script Editor, finding the right location to save it so that it will appear in the Scripts menu (not included in hint), compiling & saving the script, finding a message from the person you want, selecting the message, running the script from the script menu, and typing in the name of the folder all don't count, then, right?

And since when is creating a rule to send one person's mail to one specific folder a repetitive task? Face it, this is a pointless workaround for a problem that doesn't exist.



[ Reply to This | # ]
Automate rule creation based on sender in Mail
Authored by: jporten on Jun 26, '05 04:49:03PM

db, I know people who have set up hundreds of such rules to manage their senders. This would have been useful to them. Chill.



[ Reply to This | # ]
Automate rule creation based on sender in Mail
Authored by: Zonker1967 on Aug 17, '06 08:10:56AM

Back in the day, Eudora would let you select a message and then create a folder on-the-fly while trying to file a message. I came across this hint while searching for something similar in Mail.app, moving the message to a previously non-existent folder.

I can't believe that Mail.app still doesn't have that feature. I get so frustrated when I'm trying to move a message (or create a rule which moves a message) and realize after I've started that my destination folder doesn't exist. So I have to quit the operation, find/select the folder I want as the parent folder, create the new folder, move BACK to the location of the message to be moved and start from Square One. What a pain.

If I understand this hint correctly, it provides this missing functionality. So, I see this hint as being extremely useful, filling in a gap in the feature set that Apple has provided.



[ Reply to This | # ]
Automate rule creation based on sender in Mail
Authored by: jackAlbright on Jun 22, '05 05:15:46PM

What about a simple Smart Mailbox, or aren't you running Tiger?

jack albright
http://www.lemonstreetdesign.com/



[ Reply to This | # ]