Page 1 of 1

Matching date with spaces

PostPosted: Tue Jan 21, 2025 10:27 am
by benr
I have a "contains match" rule that sets a custom date token based on file content. Some of the content has spaces in the date (e.g. "1 2 / 1 5 / 2 0 2 4") because of less-than-optimal OCR and therefore Hazel doesn't recognize the string as a date. Is there a way I can set a date format that will match this, or some other way to handle this case?

Re: Matching date with spaces

PostPosted: Wed Jan 22, 2025 9:52 am
by Mr_Noodle
Have you tried Hazel's text recognition? You can set it to override (it won't overwrite the OCR in the file though).

Re: Matching date with spaces

PostPosted: Wed Jan 22, 2025 6:16 pm
by robbier1958
Funny, I have the same issue on a monthly statement. It has not always been an issue, but maybe it started a couple of months ago. I already OCR'd the paper document and trashed the paper. I changed the new text recognition feature to "always" for this rule, but that did not help the date issue. HOWEVER, now Rule Preview is reading and recognizing the date using the new text recognition feature!

I think the failure to recognize the date using "rule preview", after I first set text recognition to "always", was caused by not waiting long enough for Hazel to start using the new setting.

Rule Preview says that my the PDF file matches the rule. However, when Hazel processes the folder, no action to the PDF occurs.

Re: Matching date with spaces

PostPosted: Thu Jan 23, 2025 9:45 am
by Mr_Noodle
Actually, it's a bug where changing the text recognition setting doesn't update the preview. You need to turn the preview off and on or do something else that would cause it to re-try the rule conditions.

Re: Matching date with spaces

PostPosted: Thu Jan 23, 2025 10:47 am
by robbier1958
Now Preview says the file matches the rule conditions.
However when Hazel processes the folder, this rule does not perform any action (rename the file using the date token, and move the file to a different folder).

Re: Matching date with spaces

PostPosted: Fri Jan 24, 2025 10:46 am
by Mr_Noodle
Try the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Re: Matching date with spaces

PostPosted: Mon Jan 27, 2025 12:24 pm
by robbier1958
benr wrote:I have a "contains match" rule that sets a custom date token based on file content. Some of the content has spaces in the date (e.g. "1 2 / 1 5 / 2 0 2 4") because of less-than-optimal OCR and therefore Hazel doesn't recognize the string as a date. Is there a way I can set a date format that will match this, or some other way to handle this case?


I have been using a ScanSnap S1300i scanner for a long time, and was using the ScanSnap Settings, File Option, check box "Convert to Searchable PDF" . I recently encountered the same problem that you described. As part of troubleshooting this issue, I have now Disabled File option "Convert to Searchable PDF", and created a new Profile that Sends the Scan to the ABBY FineReader app, which performs the Searchable OCR function, without the spaces in the dates. In my case ABBY FineReader was included with the ScanSnap software package, but I had never saw a need to use it.