Page 1 of 1

Preview rule correct but rule when run is not

PostPosted: Fri May 18, 2018 7:31 am
by nickg
I have a rule watching a folder of camera images, a mix of jpg and some with matching cr2 raw images. The rule is:
Code: Select all
If all match:
  name matches •name
  extension is jpg
  if all conditions met for enclosing folder
    if all conditions met for any subfiles or subfolders
      name matches •name
      extension is cr2

Preview correctly shows the rule failing when jpg has no matching cr2
When the rule runs (the only rule for the folder), all jpg are matched.

The log file says each jpg matches the rule.
Is there something wrong with the sequence of conditions in the rule? If so, why does preview say that the rule is not matched when a corresponding cr2 is found?

Re: Preview rule correct but rule when run is not

PostPosted: Fri May 18, 2018 11:09 am
by Mr_Noodle
Looks like indentation is lost (try using [code] tags) but from what I can tell, the conditions match if the jpg does have a cr2 file, which is the opposite of what you described.

Re: Preview rule correct but rule when run is not

PostPosted: Fri May 18, 2018 11:26 am
by nickg
My apologies, code tags now used in the original post, which should have been clearer.

I am trying to tag all jpg that do have a corresponding cr2 file, ultimately so I can delete or move them.

The problem I am encountering is that when a file is selected in Preview mode it matches my intent (i.e. the rule is matched only when a jpg has a corresponding cr2 in the same folder) but when the rule runs, all jpg are matched whether or not there is a corresponding cr2.

Re: Preview rule correct but rule when run is not

PostPosted: Mon May 21, 2018 10:36 am
by Mr_Noodle
Go through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Start from the second step (rule status UI) onwards. Make sure the jpgs aren't matching a different rule and check the logs to see what is actually happening there. Report back with the results.

Re: Preview rule correct but rule when run is not

PostPosted: Tue May 29, 2018 5:04 am
by nickg
I have reviewed the troubleshooting guide again and run a test on a separate folder using a slightly modified rule:
Code: Select all
If all match:
  name matches •name
  extension is jpg
  extension matches •extension
  if all conditions met for enclosing folder
    if all conditions met for any subfiles or subfolders
      name matches •name
      extension does not match extension

There is only this one rule applied to the folder.
The folder contains files:
1.jpg
1.rw2
2.jpg
2.cr2
3.jpg

Preview of 1.jpg or 2.jpg matches the rule, 3.jpg fails the rule. This is the expected behaviour.
However, when the rule is run all three jpg files match the rule. It is as if the conditional part of the rule is ignored.

The log simply states that those three jpg files match the rule. No errors are reported.

I am not sure where to go from here.

Re: Preview rule correct but rule when run is not

PostPosted: Tue May 29, 2018 2:57 pm
by Mr_Noodle
Is there another "3" file in a subfolder? The way the condition is structured, it doesn't have to be in the same folder.

Instead, you might want to use "any file in the same folder".

Re: Preview rule correct but rule when run is not

PostPosted: Tue May 29, 2018 4:09 pm
by nickg
There is no subfolder in the folder, nor any file elsewhere named 3.ext

On your suggestion, I have tried the following, which unfortunately shows the same behaviour:

Code: Select all
If all match:
  name matches •name
  extension is jpg
  extension matches •extension
  if all conditions met for any file or folder in the same folder
    name matches •name
    extension does not match extension


The preview shows 1.jpg and 2.jpg match, whilst 3.jpg and all raw files do not match. However, when run, all three jpg files match (but the raw files don't match).

Re: Preview rule correct but rule when run is not

PostPosted: Wed May 30, 2018 10:47 am
by Mr_Noodle
Can you email in to support with an export of the rule as well as a screenshot of the files in the folder?