Page 1 of 1

Automate a Hazel Rule with a script, shortcut or ...

PostPosted: Fri May 03, 2024 9:49 pm
by MortenBrun
Hi

Has anybody been able to turn on or off a rule from outside of Hazel?
Either by a script, Mac shortcut, Key macro or....

Thanks beforehand.

Re: Automate a Hazel Rule with a script, shortcut or ...

PostPosted: Mon May 06, 2024 11:13 am
by Mr_Noodle
Hazel has AppleScript support for that.

Re: Automate a Hazel Rule with a script, shortcut or ...

PostPosted: Mon May 06, 2024 6:01 pm
by MortenBrun
Mr_Noodle wrote:Hazel has AppleScript support for that.


Thanks your response, but where can I find some examples and/or documentation?

/morten

Re: Automate a Hazel Rule with a script, shortcut or ...

PostPosted: Tue May 07, 2024 11:17 am
by Mr_Noodle
You can search around for general AppleScript tutorials. The manual has some specifics about how to use the AppleScript with Hazel.

Re: Automate a Hazel Rule with a script, shortcut or ...

PostPosted: Tue May 07, 2024 12:32 pm
by smm
Another option is to save an empty file (such as with “echo > flag” whenever you want the rule to be active (or inactive), and then check for the presence (or absence) of the file “flag” as one of the rule’s triggering conditions.