Preview rule correct but rule when run is not

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Preview rule correct but rule when run is not 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?
Last edited by nickg on Fri May 18, 2018 11:12 am, edited 1 time in total.
nickg
 
Posts: 5
Joined: Fri May 18, 2018 7:20 am

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.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Preview rule correct but rule when run is not 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.
nickg
 
Posts: 5
Joined: Fri May 18, 2018 7:20 am

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.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

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.
nickg
 
Posts: 5
Joined: Fri May 18, 2018 7:20 am

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".
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

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).
nickg
 
Posts: 5
Joined: Fri May 18, 2018 7:20 am

Can you email in to support with an export of the rule as well as a screenshot of the files in the folder?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support