

Then enter sh space, then drag and drop the path to the text file you just created on top of the window and press enter. Otherwise use the default value (which is two digits long "01").įormatted_episode_number="0$"

# If the episode is one digit in length (such as "1") add a leading zero.

Season_number="$(ffprobe "$episode_path" -v quiet -show_entries format_tags="season" -of default=nw=1:nk=1)"Įpisode_number="$(ffprobe "$episode_path" -v quiet -show_entries format_tags="episode" -of default=nw=1:nk=1)" Original_episode_title="$(ffprobe "$episode_path" -v quiet -show_entries format_tags="title" -of default=nw=1:nk=1)" Output_episodes_folder="/Users/Family/Desktop/Output"įor episode_path in "$path_to_episodes_folder/"* Set the terminal current working directory to the folder you'd like to output to by entering cd then drag and drop the folder from a finder window on top of the terminal window and it will automatically enter the path with any necessary escape characters so you can press enter.Īfter that copy this into a text file (change the input folder to be correct and save it): path_to_episodes_folder="/Users/Family/Desktop/Folder With Spaces In The Name"
#IFLICKS 2 ADD IMAGE DOWNLOAD#
This uses ffmpeg so if you don't have that open the terminal application and download the homebrew package installer by entering this: This was done with iTunes 12.9.5.5, macOS Mojave 10.14.6.
#IFLICKS 2 ADD IMAGE TV#
While experimenting with this I noticed that some TV shows have episode numbers that are three digits already. The script could be cleaned up and made more efficient but I wrote it this way so it was easier to follow.īe sure to select the shows, not the playlist. Set theNewName to theSeasonNumber & theTwoDigitEpisodeNumber & " " & theName as string Set theTwoDigitEpisodeNumber to characters -2 thru -1 of thePaddedEpisodeNumber as string Set thePaddedEpisodeNumber to "0" & theEpisodeNumber as string Set theEpisodeNumber to episode number of aShow Set theSeasonNumber to season number of aShow Start by selecting the shows in a playlist. I think this will do it for you: use AppleScript version "2.4" - Yosemite (10.10) or later Can someone point me in the right direction? I'm looking for a script that I can use to select entire playlists or shows and only changes the one tag (the episode name) using info from other tags that I already have populated (the original episode name, season number, and episode number) and that can pad the episode number 0-9 to 2 digits.
#IFLICKS 2 ADD IMAGE UPDATE#
I have used Subler and iFlicks, and both can handle prepending the information and adding to iTunes going forward, but if I drop my older library files to those apps, some of my comments, groupings, etc., get erased using their update metadata options (in iFlicks 2, the artwork also gets changed, and I have to handle each season separately to change it back), and neither handle extended episodes or DVD vs Aired orderings well when starting from a clean slate. I would like to prepend the season number and the (padded 2 digit) episode number to the beginning of episode names in my library (not the file name!), so I get something like 101 Pilot, 102 Deep Throat, 103 Squeeze, etc., in my smart playlists for using on AppleTV (because the newer AppleTVs running tvOS do not show that additional information in the playlist view, and it's easy to lose your place in long running series). I've been doing management with Doug's Scripts for over a decade, but the one that would be most useful (Append to Selected Tag) doesn't offer the correct fields to adjust the information I want to change. I'm not knowledgeable about scripting, so I'll be upfront about that.
