How can I run rules at a scheduled time?

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

How can I run rules at a scheduled time? 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!
monsieurmac
 
Posts: 5
Joined: Sat Feb 18, 2012 4:23 pm

Re: How can I run rules at a scheduled time? 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.
Pe8er
 
Posts: 21
Joined: Sun Nov 06, 2011 12:52 pm

Note that 3.0 (due out soon...hopefully) will have support for this.
Mr_Noodle
Site Admin
 
Posts: 11252
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: How can I run rules at a scheduled time? Mon Feb 20, 2012 3:30 pm • by Pe8er
Oh wow, I didn't notice this option before. Well done! :)
Pe8er
 
Posts: 21
Joined: Sun Nov 06, 2011 12:52 pm


Return to Open Discussion

cron