Hi Mr_Noodle,
thanks for taking this into consideration!
Reading you questions I now understand why this is not an easy task. Please bear with me if I can not just give you a short answer because I think there is another issue here, namely the convention to run a rule only once per file:
1. It raises some questions as it is now:
- What if I change the conditions of a rule already matched? Will it run again if it still matches?
- What if I only change the actions? Will they run again?
- What if I duplicate a rule? Will the identical copy run again? Does this depend on if I put the identical copy above or below the already matched original rule?
- What if I rename, or touch, or tag the already matched file? Will the already matched rule still not get applied again? In other words: when does a file stay "the same" file?
I am sure the answers are documented somewhere, but my point is: this feature is not self explaining at all. It is confusing.
2. As you can see from your questions below: with continued matching, more not really intuitive design decisions will have to be made.
3. Consider what I think is a necessary feature for multi rule matching: a setting in each rule to either "Stop after this rule" or "Continue with next rule". Now, what if a rules has matched, but then I toggle this setting from "Stop after this rule" to "Continue with next rules"? Will Hazel still not re-run the rule, but honour my choice to continue with the following rules? This will get very obscure I am afraid, no matter if the answer is yes or no.
My suggestion is:
- If a rule matches a file, just run it. It should not matter if it did match before or not. I should not matter if any other rules match.
- If a user does not want to run a rule more than once, he/she has to make this explicit. I do this by appending a comment to the file and checking for the absence of the comment in my conditions. Maybe make this easier by offering a default condition/action like this. But often I can easily check in my conditions if the action was applied already, for example if the action did set a label.
- In each rule, add an option to "Stop after this rule". Make the state of the option visible in the list of all folder rules (a little "Stop" sign, maybe).
With this, rules would become easy to design and intuitive. I understand this is a big change, so maybe in a new major version? Or in a new product?
Still, let me answer your questions assuming the "match a rule only once" mechanism must stay:
Here is my scenario:
1. Please provide a concrete example of how you would use this. If you cannot provide this, then please do not continue.
In my Downloads folder, I would like to:
1. Label every new file/folder (created <= 1 day) green
2. Unlabel every non-new file/folder (1 day < created <= 4 weeks)
3. Label every old file/folder (4weeks < created) red
4. Rename every file/folder according to the following scheme (e.g.: "New.File_2011.txt" -> "New File 2011.txt"):
"." -> " "
"_" -> " "
5. Move every file of kind movie to my Movies folder
6. Move every file with extension ".txt" to my Documents folder
7. Apply the rules recursively to any folder
2. Hazel currently will re-run rules on a file if the rule it matches changes. So if Hazel matched rule A before and now matches rule B instead, rule B will get run. But if it keeps matching rule A as before, nothing will happen. With this in mind, apply the following scenario to the workflow you described in #1 above:
A file matches rules A, B, and C in that order.
Suppose it no longer matches A, but matches B and C. Do B and C get executed again?
B and C do not depend on A. So, with the current mechanism, still do not run them again.
Suppose it no longer matches B? Does A get executed again? How about C?
A and C do not depend on B. So, with the current mechanism, still do not run them again.
Suppose it now matches rule D after the others. Do A, B, and C get executed again before D?
A, B and C do not depend on D. So, with the current mechanism, still do not run them again.
Suppose it matches rule Z before rule A. Do A, B and C get executed again after Z?
A, B and C do not depend on Z. So, with the current mechanism, still do not run them again.
3. Are you willing to accept numerous side effects of this feature? For example, if rule A moves the file outside the folder, certain pieces of metadata may not make sense anymore (folder level) or just won't work because of implementation details ("is among") for any subsequent rules.
No, because this would be very confusing. I would expect that if a rule changes a file, then the next rule will see the changed file (or not see it at all, if it was moved away). I understand that this would have an impact on performance, but this may be lessened by an intelligent caching mechanism: cache all file attributes in memory, but make certain actions invalidate certain cached attributes (e.g., changing the name does not invalidate the cached label, but running an external script invalidates all files - or at least this one).
Hope this makes sense,

Olaf