Page 1 of 1

Custom Date Token - File Name

PostPosted: 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

Re: Custom Date Token - File Name

PostPosted: 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.

Re: Custom Date Token - File Name

PostPosted: 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.

Re: Custom Date Token - File Name

PostPosted: 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!