Files renamed w wrong month

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

Moderator: Mr_Noodle

Files renamed w wrong month Sun Aug 02, 2020 11:39 pm • by tantramar
Hazel’s behaving in a way I’ve never seen before.

It’s renaming files for me, based on a date in the file (when a receipt was emailed). The odd thing, though, is that it’s using “08” as the month, even when it should be “06” or “07”.

It’s getting the year (so far they’re all 2020 files, so this may not mean much) and the day correct.

So a file internally dated “2020-06-27” in one instance and “Jun. 27, 2020” in its second, is getting renamed “2020-08-27” (when I’m expecting “2020-06-27”).

Strange? Anyone else seen anything like this before? The files in question are email messages printed to PDF (from Mailmate), and the only odd thing I can think of is that in some cases, the first date — the date header in the email — is offset by a day as compared to the date on the receipt. None of these file-dates straddle the end of one month and the beginning of the next.

This isn’t a new Hazel rule, either, though I hadn’t invoked it in ages; it’s possible it was always borked and I just failed to notice, but I don’t think so?

Hazel 4.4.5 (build 1576); macOS 10.15.6.
tantramar
 
Posts: 16
Joined: Wed Dec 07, 2016 1:01 am
Location: New Brunswick, Canada

Re: Files renamed w wrong month Mon Aug 03, 2020 9:53 am • by Mr_Noodle
Can you post/email in the rule?
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Files renamed w wrong month Mon Aug 03, 2020 10:18 am • by tantramar

Re: Files renamed w wrong month Mon Aug 03, 2020 11:43 am • by tantramar
Mr_Noodle wrote:Can you post/email in the rule?


Are those screenshots helpful/sufficient, or would you like to see something more?
tantramar
 
Posts: 16
Joined: Wed Dec 07, 2016 1:01 am
Location: New Brunswick, Canada

Re: Files renamed w wrong month Mon Aug 03, 2020 1:03 pm • by EdBurke
In my experience Hazel sometimes has a problem seeing a date that is too close to the top of a page. Try not considering an occurrence at the top of the page when counting...or set the count from the end of the file.

I setup your rule to act on one of my old Apple Subscription Confirmations and it would not get the email date at the top of the page.
EdBurke
 
Posts: 28
Joined: Wed Apr 18, 2012 6:58 am

Re: Files renamed w wrong month Mon Aug 03, 2020 7:33 pm • by tantramar
EdBurke wrote:In my experience Hazel sometimes has a problem seeing a date that is too close to the top of a page...


Great idea! Thanks — I’ll try that.
tantramar
 
Posts: 16
Joined: Wed Dec 07, 2016 1:01 am
Location: New Brunswick, Canada

Re: Files renamed w wrong month Mon Aug 03, 2020 10:49 pm • by tantramar
EdBurke wrote:…set the count from the end of the file…


Worth a shot; an item filed with today’s date (internally) got correctly renamed “2020-08-03”, but one from July 3rd also came out as “2020-08-03”.

So weird.
tantramar
 
Posts: 16
Joined: Wed Dec 07, 2016 1:01 am
Location: New Brunswick, Canada

Re: Files renamed w wrong month Tue Aug 04, 2020 7:41 am • by EdBurke
I tried your rule again this morning and realized the date of the month format you're using in the date match could be causing the problem. 31 is looking for a leading zero...try changing the date format to 31. Using 31 in the date match returned erroneous results for me.

By the way, Hazel is able to see the date at the top of the page in the emails I have used for debugging.

If the above suggestion doesn't work, an outline of your workflow might be of value...including the email client you're using.
EdBurke
 
Posts: 28
Joined: Wed Apr 18, 2012 6:58 am

Re: Files renamed w wrong month Tue Aug 04, 2020 10:24 am • by Mr_Noodle
Also, I suggest using the preview features. That will highlight the text in the document that it's matching.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Files renamed w wrong month Wed Aug 05, 2020 10:38 am • by tantramar
Mr_Noodle wrote:Also, I suggest using the preview features. That will highlight the text in the document that it's matching.


I feel like I’m missing something important, here. :)

I’ve been using preview to see which individual conditions of any given rule pass or fail: Red  ×  or green √.

Are you saying there’s a way to visually preview the text matches (or lack thereof) for “Contents contain xyz” conditions within a target file?!?
tantramar
 
Posts: 16
Joined: Wed Dec 07, 2016 1:01 am
Location: New Brunswick, Canada

Re: Files renamed w wrong month Wed Aug 05, 2020 10:42 am • by Mr_Noodle
Click the red X or green checkmark.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Files renamed w wrong month Wed Aug 05, 2020 11:26 am • by tantramar
Mr_Noodle wrote:Click the red X or green checkmark.


O M G

Mind: blown.

How did I never think to try this?

Thanks!
tantramar
 
Posts: 16
Joined: Wed Dec 07, 2016 1:01 am
Location: New Brunswick, Canada


Return to Support