Rules with "contain" condition no longer work

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

Moderator: Mr_Noodle

Rules with "contain" condition no longer work Wed Aug 19, 2020 10:07 pm • by khorton15
I'm having issues with rules that use "contain" conditions to select PDF documents. The conditions, which worked in the past, no longer work. Preview shows that the conditions are not matched. The text in the condition is found in the document, as evidenced by "hazelimporter ...". The rules start working again if I change the conditions from "contain" to "contain match".

I have stopped and restarted Hazel. I have rebooted the computer. Nothing helps.

Any insight is appreciated, as changing all the "contain" conditions to "contain match" would be a large project.
khorton15
 
Posts: 4
Joined: Wed Aug 19, 2020 5:05 pm

"contain" uses Spotlight so it would seem that your Spotlight index needs to be fixed. Make sure that the folder/files in question do not fall under your Spotlight privacy settings and look up online for how to re-build the index (there are several methods so choose the one you are most comfortable with).

Alternatively, you can keep using "contain match", which does scan the file directly, at the expense of performance.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:"contain" uses Spotlight so it would seem that your Spotlight index needs to be fixed. Make sure that the folder/files in question do not fall under your Spotlight privacy settings and look up online for how to re-build the index (there are several methods so choose the one you are most comfortable with).

Alternatively, you can keep using "contain match", which does scan the file directly, at the expense of performance.

Thanks for the info and advice.

I've triggered a rebuild of the Spotlight index. Fingers crossed that this works and lasts.

If a rule has multiple "contain match" conditions, does it read the file once for each condition, or are the file contents cached somehow? I'm wondering how big the performance hit is if I have complicated sets of conditions.
khorton15
 
Posts: 4
Joined: Wed Aug 19, 2020 5:05 pm

There may be something else going on. Spotlight finds the files using the same text as in the condition (as evidenced by mdfind), but the Hazel does not see the file as a match.

I'll switch to "contain match" as required to keep things working. But maybe there is a bug lurking.
khorton15
 
Posts: 4
Joined: Wed Aug 19, 2020 5:05 pm

Does the text you are looking for also appear in the file name?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Does the text you are looking for also appear in the file name?

No. The file name was very generic.
khorton15
 
Posts: 4
Joined: Wed Aug 19, 2020 5:05 pm

Can you email in the file and the rule?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Same here, running Mac OS 10.15.7
both Spotlight and Houdahspot can find the string (it's an account number inside a downloaded pdf). Number can be copied to pasteboard from Preview, and pasted into a TextEdit file. Yet Hazel cannot match using "Contents contain." When I switch to "contain match" it works. I'm running a two step rule, with name contains "estatement" and then the Contents test. So it would seem to be something between Hazel and Spotlight. Oddly, after I ran all of these tests, I was able to switch the setting back to "Contents contain" and the rule matched and processed.
redseagoby
 
Posts: 2
Joined: Sat Apr 04, 2020 12:46 pm

If it works later, that implies that Spotlight is slow to index the file. You may need to look into that.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks. Haven't tested this, but this thread suggests it is a systemic issue with Catalina.

https://apple.stackexchange.com/questio ... n-catalina
redseagoby
 
Posts: 2
Joined: Sat Apr 04, 2020 12:46 pm


Return to Support