Extracting Content & Renaming File

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

Moderator: Mr_Noodle

Extracting Content & Renaming File Fri Feb 14, 2025 12:37 pm • by robodean
So. I have been trying to create a rule that matches content in a file and then renaming the document.
I am stuck.

each file has this text on the 3rd line:
Last Updated: 8/3/2024 at 02:00 PM

I want to extract the date, and rename the file.

RULE:
Contents->contains match-> "Last Updated: [date]"
Result: Green arrow! YAY!

Then I did a test
Add comment->[date]
and it worked! also yay!
(oddly enough, Hazel extracted the date and ignored the rest of the line, and then formatted it as year-month-day, which is what I wanted, but never told it to so. still...YAY.)

BUT...when i try to rename the file, the rename does nothing. Literally.
Rename->with pattern->[date]--[name][extension]

https://share.cleanshot.com/qJHDCPSb

very confused, also help?
robodean
 
Posts: 20
Joined: Tue Aug 14, 2007 12:20 pm

Re: Extracting Content & Renaming File Fri Feb 14, 2025 12:54 pm • by robodean
I am an idiot.
And I feel the need to describe my idiocy as a cautionary tale.
My rule actually works perfectly. Why was it not working? Because I kept forgetting

TO SAVE IT.

Sigh.
robodean
 
Posts: 20
Joined: Tue Aug 14, 2007 12:20 pm

Re: Extracting Content & Renaming File Mon Feb 17, 2025 11:23 am • by Mr_Noodle
No problem. We all have those moments.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support