Page 1 of 1

Run command/script before rules?

PostPosted: Fri Dec 08, 2023 12:55 am
by Whig
Is there any way to run command or script before running rules?
I have some files which have wrong "rights?" so Hazel can't touch them but if I run short script or just one command to change those rights Hazel works perfectly.
Is there any way to run command/script before running rules or is my only solution to run that command/script example via cron?

Re: Run command/script before rules?

PostPosted: Fri Dec 08, 2023 9:47 am
by Mr_Noodle
No way to do that in general but maybe you can have a rule at the top that tries and match a file with no color label, and run a script then which fixes it and adds a label? Not sure what kind of permissions issue you are having.

Re: Run command/script before rules?

PostPosted: Fri Dec 08, 2023 10:01 am
by Whig
Mr_Noodle wrote:No way to do that in general but maybe you can have a rule at the top that tries and match a file with no color label, and run a script then which fixes it and adds a label? Not sure what kind of permissions issue you are having.


I guess that I accidentally did pretty much that when I noticed that if I make rule "Passes shell script" and "embedded script" and just copy/pasted my command to that windows. It seems to work well enough now.
I noticed that I wrote wrong when I said "rights/permissions" because it seemed to be a problem with file attributes which I needed to change before moving files.
Thank you for your help and great software =)