Hey there!
Same as @uoutLou over here: lots of tries but no success…
Here’s what I’d like to see:
Music\B\The_Beatles\[1965]-Help!\The_Beatles-Help!-[1965]-07-Ticket_to_Ride.mp3
Music\A\Artist_FirstName_LastName\[Year]-Album_Name\Artist_FirstName_LastName-Album_Name-[Year]-CD1-01-Song_Name
Music\Various_Artists\Album_Name-[Year]\Album_Name-[Year]-CD1-01-Artist_Name-Song_Name
I’d like to have the underscores shown in the names to avoid any spaces.
Thank you so much for your help!
One easy way is to assigning your name to a variable, then replace all spaces in the variable with the underscore, then write the variable. Something like:
$set(_path,Music/B/The Beatles/[1965]-Help!)
$set(_filename,The Beatles-Help!-[1965]-07-Ticket to Ride)
$replace(%_path%, ,_)/$replace(%_filename%, ,_)
If you post a copy of your current script, I can take a shot at updating it for you.
Hey @rdswift, thank you so much!
I see what you’re doing in your script! that’s cool.
Ok so the closest script I came up with (from one I found) is this one:
Here is a script that should be pretty close to what you want. It is nowhere near being optimized, but I wrote it this way to help make it clear what is being done at each step and to make it a bit easier to customize to accommodate any changes in preferences. Also, an opportunity to do a bit of teaching / coaching.
The script is set out in three stages:
Stage one sets up local variables with each of the elements that we’ll be using in the naming string. This is so that each is processed only once, and each is done separately so that it’s easy to make changes to any individual element.
Stage two creates the directory and file name templates used for the two different options (i.e.: Various Artists versus Other).
Stage three selects which template to use and applies it. This is wrapped in the code to replace all spaces with underscores, again so that the replacement is applied to the final selected template and only performed once.
$noop(
********************************************************
*** Set up the various elements that we'll use for ***
*** the naming so that we only process them once. ***
********************************************************
)
$set(_AlbumName,$left($replace(%album%,/,_),70))
$set(_TrackName,$left($replace(%title%,/,_),120))
$set(_AlbumYear,[$left($if2(%originaldate%,%date%,----),4)])
$set(_AlbumNameAndYear,%_AlbumName%-%_AlbumYear%)
$set(_DiscAndTrackNumber,$if($gt(%totaldiscs%,1),CD%discnumber%-,)$num(%tracknumber%,2))
$noop(
********************************************************
*** Assemble the elements into directory and file ***
*** name variables for the two different options. ***
********************************************************
)
$set(_DirectoryVA,Various Artists/%AlbumNameAndYear%)
$set(_DirectoryOther,$firstalphachar($if2(%albumartistsort%,%artistsort%),nonalpha="#")/$if2(%albumartist%,%artist%)/%_AlbumYear%-%_AlbumName%)
$set(_FileVA,%_AlbumNameAndYear%-%_DiscAndTrackNumber%-%artist%-%_TrackName%)
$set(_FileOther,%artist%-%_AlbumNameAndYear%-%_DiscAndTrackNumber%-%_TrackName%)
$noop(
********************************************************
*** Determine which option to use and present the ***
*** final directory and file name string to the ***
*** renamer. Note that the spaces are converted ***
*** to underscores at this stage. ***
********************************************************
)
$replace($if($eq(%albumartist%,Various Artists),%_DirectoryVA%/%_FileVA%,%_DirectoryOther%/%_FileOther%), ,_)
Hopefully this gets you closer to the naming format that you want.
Ok so I was just able to remove a “r” from your last line to get me closer to my goal…
$noop(
********************************************************
*** Set up the various elements that we'll use for ***
*** the naming so that we only process them once. ***
********************************************************
)
$set(_AlbumName,$left($replace(%album%,/,_),70))
$set(_TrackName,$left($replace(%title%,/,_),120))
$set(_AlbumYear,[$left($if2(%originaldate%,%date%,----),4)])
$set(_AlbumNameAndYear,%_AlbumName%-%_AlbumYear%)
$set(_DiscAndTrackNumber,$if($gt(%totaldiscs%,1),CD%discnumber%-,)$num(%tracknumber%,2))
$noop(
********************************************************
*** Assemble the elements into directory and file ***
*** name variables for the two different options. ***
********************************************************
)
$set(_DirectoryVA,Various Artists/%AlbumNameAndYear%)
$set(_DirectoryOther,$firstalphachar($if2(%albumartistsort%,%artistsort%),nonalpha="#")/$if2(%albumartist%,%artist%)/%_AlbumYear%-%_AlbumName%)
$set(_FileVA,%_AlbumNameAndYear%-%_DiscAndTrackNumber%-%artist%-%_TrackName%)
$set(_FileOther,%artist%-%_AlbumNameAndYear%-%_DiscAndTrackNumber%-%_TrackName%)
$noop(
********************************************************
*** Determine which option to use and present the ***
*** final directory and file name string to the ***
*** renamer. Note that the spaces are converted ***
*** to underscores at this stage. ***
********************************************************
)
$replace($if($eq(%albumartist%,Various Artists),%_DirectoryVA%/%_FileVA%,%_DirectoryOther%/%_FileOther%),[?*:\\/_ ]+,_)
And that’s how I’d like to see it:
Music/B/The_Beatles/[1965]-Help!/The_Beatles-Help!-[1965]-07-Ticket_to_Ride.mp3
Music/Various_Artists/[2005]-Coup_d’État,_Volume_1:_Ku_De_Ta_Prologue/Coup_d’État,_Volume_1:_Ku_De_Ta_Prologue-[2005]-CD2-05-Snowboy_feat._James_Hunter-I’ve_Got_to_Learn_the_Mambo