Adjust the date to first day of the next month?

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

Moderator: Mr_Noodle

Is there a way to have Hazel find a date in a pdf file and then automatically adjust it to the first day of the next month?

The reason: One of my favorite uses of Hazel is to identify monthly bills in my downloads folder, move them to a 'bills' folder and then rename the file and sort them into subfolders by year and bill type. Unfortunately, with new accounts (and ever-changing pdf layouts from existing accounts) the place I spend the most time on is having Hazel identify the correct date I want. Sometimes there is the letter date, the billing date, the coverage dates, etc. After trial and error I am usually able to get it by finding a unique way the specific date I want is presented... but not always.

As an example: I have a new health insurance company and I would like the bill to be sorted by the first day of the month of coverage (not the billing date). For some reason due to the layout I cannot isolate this for Hazel. But what would be easy is to grab the first date of the pdf. This will always be within the month prior to what I wish to name the file. So if Hazel could find the first date within the email ("Feb 5, 2025") and automatically change it ("Mar 1, 2025") then I can have the file renamed to '2025-03-01 - Health Insurance' and sorted accordingly.

Thanks!
morganadam
 
Posts: 2
Joined: Tue Sep 29, 2009 10:15 pm

So I came up with my own solution if this helps anyone else. I had Hazel auto detect the first date found. Then I had it adjust the date by adding 1 to the month. Then for the file name I used the date format to rename the file with only year and month (ex. "2025-03") and then append the day by text ("-01").

Still curious if there was a more direct way I'm missing...
morganadam
 
Posts: 2
Joined: Tue Sep 29, 2009 10:15 pm

Nope, that sounds about right.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support