Grouping rules for the same folder in Hazel


My only problem with Hazel is the management of a large number of rules that monitor the same folder. I find it unwieldy to scroll up and down looking for the right one. One folder in particular (called “Action”) for me is getting insane.

So I tried figuring out a way to “group” rules in Hazel. My first attempt was to create a set of Smart Folders and have them show all the contents in a particular folder. My plan was to add the smart folders to Hazel and put groups of rules in each. For some reason Hazel couldn’t see the files in the Smart Folders even though the Finder could.

My second solution was to put a set of sub-folders into the Action folder. I added a rule that moved any file in the Action folder to the first sub-folder. The first folder has a group of related rules. Then it has one extra that moves any non-matched file to the next sub-folder. And so on, and so on, until the last sub-folder.

This works a lot of the time but not always. Some files don’t get matched to their rules, even though they should have, and get pushed forward in the folder chain—where they should no longer match any rules and traverse their way to the end of the chain (the no match bucket). If I disable the move-to-next-folder rule, the files just sit there until I do something like open one of the files then suddenly Hazel matches it and performs an action. What??? It appears that the rules that tend to fail to match all have one or more “Contents contain” rules.

Any ideas on how to make this work? Or a complete different way to group rules (for manageability) that are used for a single folder?

Any help appreciated.

Mojave 10.14.3 ; Hazel 4.3.4

There is a limitation on monitoring Smart Folders with Hazel – perhaps this note in Hazel’s Help file appiies:

Important: Because Smart Folders represent files that may be located anywhere on your Mac, Hazel rules for Smart Folders cannot descend into subfolders or match against subfiles.

Without knowing what the rules are that you are applying to your “Action” folder, it is hard to give more than a few generic answers to your “any ideas?” question:

  1. Ask Noodelsoft. The Hazel forum is very helpful, and the developer is very direct in addressing problems as long as you give concrete info about the rules and the context you are applying them in.
  2. Rethink why you are using all these rules in the first place. Pick up paper and pencil and try to figure out the logic you want to program. Hazel does things in real time – though it can be paused – but it can be hard to program Hazel while Hazel is operating. Also, if you cannot step back and diagram the logic, then you don’t really understand the problem you are trying to solve.
  3. Start over. Turn off all the rules for “Action”, add them back one at a time until you get a failure point.
  4. Combine rules and look for opportunities to simplify them.
  5. Split your data into multiple folders – not into subfolders. When you create rules that go up and down in a folder hierarchy you can run into the risk of circular logic – a rule causes a file to move down in the hierarchy, a second rule causes it to move up a level, the first rule takes over again, etc. Try using rules to move files out of “Action” where the are then operated on by rules in the destination folder.
1 Like

Interesting questions. I agree with quorm, diagram what you’re trying to do.

My solution is tags. I have Hazel and ScanSnap route everything from downloads and scans into my @action folder. From there Hazel rules rename files, tag them, and move them to specific destination folders.

As I receive the monthly utility invoice into @action folder, for example, Hazel applies my naming convention, tags it “current,” then moves it to it’s final resting place. When billpay day comes I click on the “current” tag which displays all the day’s invoices in Finder. (I’ve yet to find a way for Hazel to pay them for me :slightly_smiling_face:)

I send everything to @action but not all get acted on by Hazel. Some documents need personal intervention.

@MellowRen, I don’t know if that will help. I hope you find your solution.

1 Like