Page 1 of 1

Rule matching in preview, but not otherwise?

PostPosted: Sat Nov 05, 2022 12:43 pm
by ciaran
I've set up a rule that, if it sees a .txt file in my Downloads folder with a specific word in the file name (say `CLIENT`), it should fire off a shortcut that makes some modifications to the content of that file.

Hazel confirms that the rule matches a file when in preview mode. But the log file does not reflect the rule matching, even when the rules are forced to run via the "Run rules now" command.

Any reason this might be?

Re: Rule matching in preview, but not otherwise?

PostPosted: Mon Nov 07, 2022 10:21 am
by Mr_Noodle
Please go through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Report back with the results of each test.

Re: Rule matching in preview, but not otherwise?

PostPosted: Mon Nov 07, 2022 3:25 pm
by ciaran
Mr_Noodle wrote:Please go through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Report back with the results of each test.


1. Preview indicates that the rule matches the file.

2. Rule status does **not** show that the rule matches the file.

3. The Log file does **not** include a reference to the file.

For greater context, here's an overview of the process:

Rules apply to the Downloads folder:

1. Download a file named `ledes1998b.txt` to Downloads folder
2. Rule 1 checks for `ledes` in the name of a file with a `txt` extension, and adds a red tag to the file. (Rule 1 works as expected)
3. I rename the file so that it now includes `CLIENT` in the name.
4. Rule 2 checks for `CLIENT` in the name of a file, and if it finds it, is supposed to run a Shortcut on that file (that manipulates internal text and changes the label to green).

It's Rule 2 that matches in preview, but doesn't match in rule status or the logs.

Re: Rule matching in preview, but not otherwise?

PostPosted: Tue Nov 08, 2022 10:26 am
by Mr_Noodle
Does Rule Status show no rule or a different one for that file?

Re: Rule matching in preview, but not otherwise?

PostPosted: Tue Nov 08, 2022 1:48 pm
by ciaran
Mr_Noodle wrote:Does Rule Status show no rule or a different one for that file?


It shows Rule 1.

Re: Rule matching in preview, but not otherwise?

PostPosted: Wed Nov 09, 2022 10:50 am
by Mr_Noodle
That means it's matching rule 1. It won't match any rule after that because it already matches that one. If you want it to match subsequent rules, you need to either re-arrange the rules or use a Continue action on any rules preceding it.

Re: Rule matching in preview, but not otherwise?

PostPosted: Wed Nov 09, 2022 9:56 pm
by ciaran
Mr_Noodle wrote:That means it's matching rule 1. It won't match any rule after that because it already matches that one. If you want it to match subsequent rules, you need to either re-arrange the rules or use a Continue action on any rules preceding it.


Got it. Thanks, and sorry for missing that somehow!