Page 1 of 1

Apply different rules to different folders

PostPosted: Tue May 16, 2023 3:00 am
by Danny Wyatt
I have this structure

Root Folder (monitored)
- Folder A
- Folder B
- Folder C

All of these 3 folders have the exact same type of content: audio, so I can't use different rules based on the type of file, but I would like to create a rule for items in Folder A, different from the rules for Folder B and rule for Folder C.
Other than adding the 3 folders individually to Hazel (in this case I'm using 3, but it could be 10 or 20 and that would be too much for the sidebar), is there a way to achieve this? Something like "if the parent folder's name is Folder A, apply these rules"? Then it would move on to Folder B, then Folder C

Re: Apply different rules to different folders

PostPosted: Tue May 16, 2023 8:44 am
by Mr_Noodle
If each folder is going to have different sets of rules, it probably is better to have each folder monitored separately. I think it would only make things more difficult to manage having it all crammed into one ruleset.

If you insist on doing it this way, you can use a nested condition to match against the enclosing folder. Check the manual for more details.

Re: Apply different rules to different folders

PostPosted: Wed May 17, 2023 2:47 am
by Danny Wyatt
Mr_Noodle wrote:If each folder is going to have different sets of rules, it probably is better to have each folder monitored separately. I think it would only make things more difficult to manage having it all crammed into one ruleset.

If you insist on doing it this way, you can use a nested condition to match against the enclosing folder. Check the manual for more details.


In the case of just a few folders, maybe this is not an issue, but I will explore the nested conditions and see what can be done.
Thank you