Page 1 of 1

Matching Contents - Partial String

PostPosted: Wed May 24, 2017 11:27 am
by dxterra
I am sure this has been asked before, but I could not find it posted.

I have been having issues lately with some of my rules for filing bills automatically. Some of these rules use part of the account number or some other string value to match the pdf file to the rule. Lately these partial matches are failing to be found so the document isn't processed.

An example would be a pdf that contains 123456-1234 and the rule is looking for 456-1234. This used to work, but now I have to put the full 123456-1234 for the rule to match in Preview or to process the file. The substring is found when doing a search in Preview.app or Spotlight.

Am I missing something?

Re: Matching Contents - Partial String

PostPosted: Thu May 25, 2017 10:45 am
by Mr_Noodle
Try using the preview function to track down the problem: https://www.noodlesoft.com/manual/hazel ... ew-a-rule/

Re: Matching Contents - Partial String

PostPosted: Thu May 25, 2017 11:09 am
by dxterra
Thanks for the reply. I reverted the rule back to it's original and tried to process the same file again and it still failed, as expected.
I attached a screenshot of the Preview sheet along with the rule. It will only match if I use the full value.

Image

Re: Matching Contents - Partial String

PostPosted: Fri May 26, 2017 10:41 am
by Mr_Noodle
"Contents contain" uses Spotlight under the hood. Spotlight tends to favor freestanding words and not portions of words. I would recommend using "Contents contain match" here instead. It's more reliable though at the cost of some performance.

Re: Matching Contents - Partial String

PostPosted: Fri May 26, 2017 11:33 am
by dxterra
Thanks. Makes sense to me.