Can i trigger a rule with a script?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Can i trigger a rule with a script? Fri Jan 07, 2011 11:09 am • by Andreas
Hi,

i´m very happy what hazel can do, but there is one problem i have.

i set the color of a file to red. now hazel should copy this file to
another folder directly. it works only if i say "run rule". otherwise
i have to wait for about 5 minutes. but this time is to long.

so, can i shorten this interval or can i trigger a rule with a script?


thanks and greetings from germany,

Andreas
Andreas
 
Posts: 3
Joined: Fri Jan 07, 2011 11:01 am

Re: Can i trigger a rule with a script? Fri Jan 07, 2011 2:44 pm • by Mr_Noodle
This is a limitation of the file event system Hazel currently uses. The new engine in Hazel 3 uses the more modern file event system and will catch these events much sooner.

If you want to trigger things with a shell script, you can use the "touch" command, which updates the modification date, on the folder being monitored.
Code: Select all
#!/bin/sh

touch <the directory to update>

where <the directory to update> is the path to the folder that you want Hazel to process. If this script is being invoked from Hazel, I'll need more context so I can adjust the script accordingly. The above is for if you are invoking the script yourself.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Can i trigger a rule with a script? Fri Jan 07, 2011 6:26 pm • by Andreas
Hi Mr Noodle,

i will try this next week. if i need more help,
i will contact you.

when do you think will be the 3.0 version availible?

thanks from here,

Andreas
Andreas
 
Posts: 3
Joined: Fri Jan 07, 2011 11:01 am

Re: Can i trigger a rule with a script? Sat Jan 08, 2011 2:19 am • by sjk
Andreas wrote:when do you think will be the 3.0 version availible?

It's on the horizon.
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

Re: Can i trigger a rule with a script? Sun Jan 09, 2011 5:38 am • by Andreas
Hi,

it works! Great!

Thank you for your fast answer,

Andreas :D
Andreas
 
Posts: 3
Joined: Fri Jan 07, 2011 11:01 am

Re: Can i trigger a rule with a script? Mon Jan 10, 2011 4:30 pm • by Mr_Noodle
Just to make it clear, "on the horizon" is a bit vague as I don't have a set schedule, but it's on the scale of months. I have certain key things done (engine reworking, etc.) but I'm still experimenting with new features so depending on what features I decide to include in the end, it might take longer.

The beta forum and Twitter feed are probably the best places to watch for updates on this front.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support