Page 1 of 1

New to Hazel, is it possible to do what I need?

PostPosted: Thu Jul 10, 2025 12:50 am
by BabyDibbert
Hi everyone, sorry if this isn't the best place for this! I'm new to hazel and I'm trying to set up a rule to rename episode files. I'd like to change this:
[show name] - 123 - [episode name].ext
to this:
[show name] - S01E23 [episode name].ext
but the number in the filename is not always 123 obviously. I could do this with a few rounds of regex manually in a file renaming tool I have, but that would defeat the purpose of automating.
is this possible with Hazel itself or would I need some sort of secondary script in the action? I'm unfamiliar with apple or shell scripts, and automator is finicky trying to get this to work in my experience, so i'm not sure how i'd proceed.
thank you for your help!

Re: New to Hazel, is it possible to do what I need?

PostPosted: Thu Jul 10, 2025 9:20 am
by Mr_Noodle
Look up "match patterns" in the manual.

Re: New to Hazel, is it possible to do what I need?

PostPosted: Thu Aug 07, 2025 10:11 am
by Lachlan Williams
Hope nobody minds me chiming in. :D

If the filename is consistently 3 digit format, it should be easy. It's trickier if you have a show with more than 9 seasons (but doable as long as the episode is always 2 digits). I think the logic you're looking for in the pattern match would be:

CONDITION:
Name Matches: [Show] - [Season][Episode] - [EpisodeName]

In this condition, I would define the tokens (in square brackets) as follows:
[Show] = Custom Text [Anything]
[Season] = Custom Text [number]
[Episode] = Custom Text [digit][digit] (Will only work if episode is always 2 digits (eg: "103" for S1 Ep 3)
[EpisodeName] = Custom Text Anything

ACTION (Rename with pattern):
[Show] - S[Season]E[Episode] [EpisodeName][extension]

Change Number format of both [Season] and [Episode] to "00"

Here's a mockup, I made:

https://drive.google.com/file/d/1KvAqqe ... share_link

Hope it helps