Page 1 of 1

How can I run rules at a scheduled time?

PostPosted: Sat Feb 18, 2012 4:25 pm
by monsieurmac
I was hoping to run certain rules only at certain times of the day (mostly scripted stuff that launches other applications) to reduce the impact on my system when I am using it. Is there a way for me to tell Hazel to run a rule only during a certain time interval (between 11pm and 7am)?

Thanks!

Re: How can I run rules at a scheduled time?

PostPosted: Sun Feb 19, 2012 5:50 am
by Pe8er
As far as I know it's possible but definitely not straightforward.

You would need to set up a rule which triggers when a certain file is present. And then set up a crontab or recurring event in iCal, which would run an Applescript that creates this file.

Rule in Hazel:
For folder A
→ process if file F is present
→ your own rules

Event in iCal:
Repeat every day at 11 PM & alert run script → Applescript described below

Applescript:
Create (or copy) file F in folder A.

You would need another event at 7 AM that would run a script which deletes file F.

Re: How can I run rules at a scheduled time?

PostPosted: Mon Feb 20, 2012 1:17 pm
by Mr_Noodle
Note that 3.0 (due out soon...hopefully) will have support for this.

Re: How can I run rules at a scheduled time?

PostPosted: Mon Feb 20, 2012 3:30 pm
by Pe8er
Oh wow, I didn't notice this option before. Well done! :)