Converting to Hazel

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

Moderator: Mr_Noodle

Converting to Hazel Mon Dec 09, 2013 10:29 pm • by ondrovic
Could really use some help getting this converted over to an hazel rule to automatically add the s0 e0 to tv shows
Code: Select all
on makeEpisodeIdentifier(strSeasonNumber, strEpisodeNumber)
   
   set intSeason to strSeasonNumber as integer
   set intEpisode to strEpisodeNumber as integer
   
   if intSeason ≤ 9 then
      set strReturn to "S0" & strSeasonNumber
   else
      set strReturn to "S" & strSeasonNumber
   end if
   
   if intEpisode ≤ 9 then
      set strReturn to strReturn & "E0" & strEpisodeNumber
   else
      set strReturn to strReturn & "E" & strEpisodeNumber
   end if
   
   return strReturn
   
end makeEpisodeIdentifier
ondrovic
 
Posts: 6
Joined: Fri Sep 06, 2013 4:06 am

Re: Converting to Hazel Tue Dec 10, 2013 1:51 pm • by Mr_Noodle
There seems to be quite a few details missing here like where the season and episode numbers are coming from. Assuming they are included in the name of the file, you can use match patterns (search for it in the help) to pull that info out. You can then format the numbers with leading zeros when using it in a rename or sort pattern.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support