Rename and organize all MP3s by Artist and Song Title

First time trying Picard. I want to use it to rename all my MP3s as Artist Name - Song Title, add cover art if that’s possible, and organize all of them into folders by Artist Name.

Is that possible? I see the renaming field but the code in there makes no sense to me. I found the cover art settings so I think I’m ok there probably. Just not sure what to use for the renaming code in the settings, and if/how to make it organize them.


Since you’re just getting started with Picard, I suggest that you might want to have a look at the Picard User Guide. This will help guide you through the configuration.

Based on my understanding of your request, a starting point for the file naming script would be:

%artist%/%artist% - %title%

For an example of some of the things that you can do with file naming scripts, you can see the one that I use (posted on GitHub). I’ve tried to include comments throughout the code to help explain what is happening. Others have developed much more extensive scripts to meet their personal naming preferences.

If you have any questions, please just ask. Finally, welcome to the world of MusicBrainz Picard.


@rdswift Wow! That’s quite a script! Will have to get acquainted with how you’re using variables, but thank you for putting that together (maintaining it, etc.). Very cool resource for learning!

I use a much simpler script, but it accomplishes what I want:

$if2(%artist%,%albumartist%)/$if($or($eq(%albumartist%,Various Artists),$eq(%albumartist%,Various)),%album% \(Various Artists\),%album%)/$if(%artist%,%artist% - ,%albumartist% - )$if($or($eq(%albumartist%,Various Artists),$eq(%albumartist%,Various)),%album% \(Various Artists\) - ,%album% - )$if($eq($num(%tracknumber%,2),0),00,$num(%tracknumber%,2))$if(%title%,$if($or($or(%artist%,%albumartist%),%tracknumber%), - ,) %title%,)

I want to make that “The Beatles” example, output as “Beatles, The”, so it can be placed like so: /lib/B/Beatles, The/The Beatles - Album - XX - song title.flac

I think i’ve seen the code somewhere to do it. I thought I actually had it in my script, but… long story… i have been away from this sort of thing for a long time, and forgot where I put my notes, etc.

Thank you!

See for example this discussion:


Hi there. Sorry for the late reply, but I do try not to start a new thread if not necessary.

It truly is to find a needle in a haystack w/ that huge thread, and all of those one-size fits all scripts. I like that @rdswift setup a repo at GitHub. I was going to put my query there as it seems the way to go when sharing code stuffs, but…

In addition to the thoughtful tutorials for scripting/ tags & file naming already provided, what I’d like to see, (and maybe this is something we could do at @rdswift 's GitHub repo?) is a much more broken-down recommended list of snippets. In essence, I suppose that’s what we have in the Picard File Naming Script Editor => Documentation (which conveniently opens in a panel in the editor), as we can see things like $left(text,number) and $rreplace(text,pattern,replace), which for someone who knows a bit about string manipulation scripting / regex, etc., it may seem it goes-without-saying.

About once a year, I find myself trying to remember because I lose my notes in some Windows system migration, incarceration, or any number of life’s annoyances, and it’s not the activity I prefer to spend time on when it comes to consuming the media. Albeit, it is the sort of activity I prefer I do at some point, so i might better enjoy all that juicy jazzy juke-joint jezebelle-jangle! Ha!

My goal (or “A Resource Named Desire”):
Setup a repo w/ simple, categorically identifiable snippets based on common examples


– Artist Stuff
– Common Misnomers:
– Fix “The Artist_Name”, when artist is “Artist Name” [
if(%artist_name% HAS “The Artist” && %real_artist_name% ! HAS "The ") { remove prefix “The” }
] obviously an example, made up script.
– Fix “Jimmy Hendrix” to “Jimi Hendrix”
– some other script that fixes that situation
– Directory Structure
– Organize by Artist
– Start the file rename script with /your/path/to/media_files/%artist%/
where %artist% becomes a folder
– AlphaNumeric Nodes
– Make a directlry like /path/A/Abba
– and the scripting to accomplish it correctly.

My point being. I look at enough code all day long. I personally don’t care to do it when I’m trying to listen to music. So, I really don’t care who came up w/ a one-size fits-all script, and whether it can replace and reformat the tag to suit some Standards compliance likely to be deprecated by some Giant like Spotify or whatever in a few months. I just don’t care anymore. All the AI does it for you. What’s the point in wasting the time on it.

BUT. I do want to have my personal folders alpha numerical like that. For me, that works. This old dog knows a few tricks, but all I really want is the bone.

Allegedly Picard is based on the fb2k script engine, whatever that means. But, my fb2k script,
$if($stricmp($left(%artist%,4),The ),$substr(%artist%,5,5)'/'$substr(%artist%,5,244)', '$substr(%artist%,1,4)'/',$left(%artist%,1)'/'%artist%'/')$if(%album%,$if($or($stricmp(%album artist%,Various Artists),$stricmp(%album artist%,Various)),%album% '(Various Artists)'$if($isgreater($num(%disc%,2),0,'disc number true','disc number false'),'[disc '%disc%']/','/'),%album% $if($isgreater($num(%disc%,2),0,'disc number true','disc number false'),'[disc '%disc%']/','/')),'[UNKNWON ALBUM]/')$if(%artist%,%artist%,$if(%band%,%band%,'[UNKNOWN ARTIST]'))$if(%album%,' - '%album% $if($or($stricmp(%album artist%,'Various Artists'),$stricmp(%album artist%,'Various')),' (Various Artists)',)$if($isgreater($num(%disc%,2),0,'disc number true','disc number false'),' [disc '%disc%']',),' - [UNKNOWN ALBUM]')$if(%tracknumber%,' - '$num(%tracknumber%,2),' - 00')$if(%title%,' - '%title%,' - [UNKNOWN TITLE]') doesn’t work in Picard, because some of the functions (strcmp, i think?) aren’t recognized.

So, I’m trying to recreate that for Picard (well, it truly needs changing as well; an upgrade for those deprecated [unknown] and brackets that someone doesnt like in my submitted edits. haha!).

I want my result to be:


How easy it is to please me!
Cheers, brothers and sisters!

I actually included a section for snippets in the repo on GitHub but so far there is only one entry (and I submitted it). I welcome people to contribute their ideas (and code), and am open to alternatives for making this more user friendly. In support of that, I have opened up a Discussion section on the repo.


I assume that the “/path” portion is going to be supplied from the “Destination directory” setting in the File Naming Options, so it would be included automatically when creating the output directory (and thus is not explicitly included in the script below). If I correctly understand what you’re trying to do, you can try the following as a starting point for your file naming script: