Custom Date Token - File Name

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

Moderator: Mr_Noodle

Custom Date Token - File Name Sun Aug 25, 2024 12:14 pm • by steps
I'm having an issue with a custom date token. Typically, I use the contents contain match function, but for some reason on files downloaded from this particular bank, Hazel is unable to view the contents.

I am attempting to rename the files as I typically do with an ISO date format. I thought I could get away with using the name matches function as this allows me to create the custom token still and Hazel is able to read the name. However, as shown in the image below, it does not appear to be able to extract / see a date in the file name.

Anyone have any suggestions? I have attempted to specify the date format as well, but no joy there so I have left autodetect on for now.

https://imgur.com/a/1rGpP9f
steps
 
Posts: 3
Joined: Sun Aug 25, 2024 12:07 pm

Re: Custom Date Token - File Name Mon Aug 26, 2024 8:41 am • by Mr_Noodle
Main issue is that you are using "Name matches" but only matching the date. The name has more stuff than just the date so your pattern needs to take that into account.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Custom Date Token - File Name Sun Sep 01, 2024 11:04 am • by steps
Mr_Noodle wrote:Main issue is that you are using "Name matches" but only matching the date. The name has more stuff than just the date so your pattern needs to take that into account.


Understood - so it is trying to match the entire string. Is there a way to have Hazel extract a date from the name of a file? The "matches" function does not allow creation of a custom token. Usually I use the "contents contain" to extract a custom date token, but Hazel cannot read the contents of pdf files from this particular bank - I'm uncertain as to why.
steps
 
Posts: 3
Joined: Sun Aug 25, 2024 12:07 pm

Re: Custom Date Token - File Name Mon Sep 02, 2024 9:51 am • by steps
Thanks for the guidance - managed a rule that does what I needed. In case anyone stumbles on this post in the future, here is how I formatted the rule.

https://imgur.com/a/oD2BwCA

And here is a link the the user guide, specifically with regard to match patterns:

https://www.noodlesoft.com/manual/hazel ... onditions/

Thanks again Mr_Noodle!
steps
 
Posts: 3
Joined: Sun Aug 25, 2024 12:07 pm


Return to Support