New to Picard Scripts

Hello Ya All…

Im new with the use of scripts in picard, is there someone who is willing to help me out here…
What i’m looking for is “I think” not to difficult but I can’t get this done the way I think it should be.
I would like to have a piece of script that does the following thing for me:

replace TAG withing MP3/FLAC files with this

music folder "artist"
album folder "name of album"
file renaming to "01 - “track name/song name”

if somebody can help me out please let me know or if you got a nice little piece of scripting that does this and other nice stuff please let me know…

thanks in advance

@ZeLongOne73,

I was hoping that someone would have responded by now but they haven’t so I thought I better so that you don’t think we’re ignoring you.

I might be able to help, but my problem is that I don’t clearly understand what you’re wanting to do. Can you please provide more information including an example? My confusion is that you talk about replacing tags in MP3/FLAC files, and then talk about folder and file names. I’m thinking that you might be wanting to save your MP3/FLAC files in a directory structure like:

...\artist name\album name\01 - track 1 name.mp3
...\artist name\album name\02 - track 2 name.mp3

Is this correct? If I’ve misunderstood, please provide further clarification if possible. Thanks.

1 Like

Dear Bob,

I’m so sorry for the late reply but I have been sick and now picking up some things slowly.

Thanks for your answer and I will definitely start working out this small script.

What I would like is to create a structure like this below:

Alphabetical Letter

  • Band/Artist name

  • Year - Album name

  • number of disc (if it’s more than one)

  • track - song name

Example:

A

  • ac/dc

  • 1986 - For those about to rock

  • 01 - hells bells

B

  • Boston

  • 1980 - xxxxx

  • 01 - xxxxx

And so on…

Thnxxx

rdswift Regular
November 17
@ZeLongOne73,

I was hoping that someone would have responded by now but they haven’t so I thought I better so that you don’t think we’re ignoring you.

I might be able to help, but my problem is that I don’t clearly understand what you’re wanting to do. Can you please provide more information including an example? My confusion is that you talk about replacing tags in MP3/FLAC files, and then talk about folder and file names. I’m thinking that you might be wanting to save your MP3/FLAC files in a directory structure like:

> ...\artist name\album name\01 - track 1 name.mp3
> ...\artist name\album name\02 - track 2 name.mp3

Give this a try. It might not be exactly what you’re looking for but I think it should be close.

$upper($firstalphachar(%albumartistsort%,nonalpha="#"))/%albumartist%/$left($if2(%date%,%originaldate%,0000),4) - %album%/$if($gt(%totaldiscs%,1),%discnumber%-,)$num(%tracknumber%,2) - %title%

The steps taken in the script are:

  • $upper( makes the alphabetical directory upper case.
  • $firstalphachar( returns the first alpha character of the text provided - in this case the sorted version of the album artist name. If the first character is not an alpha the nonalpha=“#” part causes it to return an octothorpe.
  • /%albumartist% inserts a path separator to create a new subdirectory called the name of the album artist.
  • /$left( inserts a path separator to create a new subdirectory under the artist directory called “year - album name”. This subdirectory is where the music files are stored. The $if2( causes the year to be the first one of “release date”, “original release date” found. If neither is present, the year is displayed as “0000”. The $left( takes only the year (i.e.: the first four digits) from the date for display.
  • $if($gt( causes the track number to be prefaced by the disc number only if there are more than one disc in the album.
  • $num( causes the track number to be padded to a two-digit number (i.e.: 01, 02, etc.) which allows proper sorting of the tracks in the directory.
  • - %title% includes the track title in the file name, separated from the track number by a hyphen.

If you wanted each disc in a separate directory the script would change slightly as:

$upper($firstalphachar(%albumartistsort%,nonalpha="#"))/%albumartist%/$left($if2(%date%,%originaldate%,0000),4) - %album%/$if($gt(%totaldiscs%,1),Disc %discnumber%/,)$num(%tracknumber%,2) - %title%

I hope this helps move you a bit closer to what you’re wanting to accomplish. For more information about scripting in Picard, there’s https://picard.musicbrainz.org/docs/scripting/ and https://picard.musicbrainz.org/docs/tags/.

edit:

Also, just to clarify this goes in the file naming script section of the options as:

3 Likes