Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a number of rules in (these ones work!) to move e-mails which are X days old to trash.

I'd like to run these rules at a specified time, eg: midnight. In this case, the particular rules will move e-mails which are older than 1 day to trash.

I use Mail Act-On and Mail Tags, but cannot find any functions there.

Is it possible with natively? If not, is it possible with some plugin? Ideally open-source.

share|improve this question

Here is how I would approach this - note it is quite technical and is recommended only to people who know what they are doing.

1) Write an Apple Script to send the keystroke to apply your defined rules in

2) Schedule a crontab to run that script at predetermined times

To start you off here is a sample script that I have written:

tell application "System Events"
tell application "Mail" to activate
keystroke "l" using {command down, option down}
end tell

Then to schedule your job (e.g. midnight) by adding a crontab entry - change the username to the user you are running as - leave osascript as it is

* 0 * * * username osascript 'path to your script.scpt'

Alternatively use a GUI to schedule the above such as cronnix

share|improve this answer
Hi, I like the approach. I hadn't thought about using applescript... "keystroke "l" using {command down, option down}" I guess this line is for the keystroke set-up in Mail Act-On to activate the particular defined rule? If so, I follow. I'll try it later on and let you know. – Bernard Tyers Jan 13 '12 at 9:11
Unfortunately I am not aware of running individual rules, the above shortcut will apply all rules that you have defined (as it is an existing shortcut) – osx86x Jan 13 '12 at 9:44
Juat to clarify: "keystroke "l" using {command down, option down}" This 'l' is an existing shortcut to apply ALL rules? thanks. – Bernard Tyers Jan 13 '12 at 10:09
Yes as in Option+Command+L – osx86x Jan 13 '12 at 10:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.