Edit file attributes from filename

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

Moderator: Mr_Noodle

Edit file attributes from filename Sat Dec 24, 2022 10:04 am • by eN0ch
I'm nowhere near geek enough to manage this, but I'll try to start at least. And maybe you can just point me to relevant topics in the manual.

I have a bunch of archived emails in PDF form in a certain folder. (Generated by an Email archiving app). The filenames begin with date/time of the original email in this format: 2020-11-21 04-58-19. (Followed by email subject). As the archives were created months / years after the emails, their date-time attributes are nothing close to those of the original emails.

What I'm hoping for is a Hazel rule that would read the date (and I suppose time, though that doesn't matter so much), and then edit the files' Finder date attributes to match the date in the filename. I'm guessing this might be a job for "match patterns"? I know zip about that, but am willing to learn. What part/s of the manual do I need to read?

Thanks.
Lance <º))><

iMac 24" 2021 M1 | macOS 13.3.1a | Hazel 5.2.1
eN0ch
 
Posts: 63
Joined: Tue Jul 01, 2008 7:41 pm
Location: Crookwell, NSW, Australia

Re: Edit file attributes from filename Sun Dec 25, 2022 2:39 am • by eN0ch
Well I'm still interested in hearing the answer here for future reference for me or others. But I've found a more noob-friendly solution thanks to another app. It doesn't quite seem politic to say which app here. But I will if I'm asked. And/or you could PM me if interested.
Lance <º))><

iMac 24" 2021 M1 | macOS 13.3.1a | Hazel 5.2.1
eN0ch
 
Posts: 63
Joined: Tue Jul 01, 2008 7:41 pm
Location: Crookwell, NSW, Australia

Re: Edit file attributes from filename Tue Dec 27, 2022 10:45 am • by Mr_Noodle
There's no built-in action to change the file times. For that part, you will need to use a script.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support