Share your custom Actions

COPY SONGS OFF IPOD :astonished:

If you want to copy someones iPod!

You will know if you have iTunes/iPod that they can only work together and you can only have one library of music per iTunes. In other words, if you tried hooking up your friends iPod to your computer, your iTunes will tell you that it already belongs to another computer's iTunes. Then it will ask if you want to delete all contents and sync your music onto it.
But hey, this isnt what we want to do. We want to copy his contents.

Here's the solution.
If you browse to the music iPod's directory -
here is where you will find all of the mp3s stored. (This is a hidden folder, so unhide it first).
But yup, all the folders, as well as the file names, are all jumbled up! How can you find a song when it's named like this?

This Action Group below will sort it out for you.

It works in two stages...

Firstly, it corrects the file name of the file by doing this -
FILENAME = "%track% - %title%"
Example: 01 - The Hollow.mp3
So as long as your mates music collection contains these two tags, the track number and the title (which he definitely should if he's using an iPod) then this will work.

Secondly, this part off the action will put all of this music into the right place, where you tell it to go!
The '%artist%' and '%album%' tags are used, so this means that you can use this action on the whole of your friends collection with one-single-click! Easy huh?
It will move it to the directory you tell it by doing this -
DIRECTORY = "C:\Documents and Settings\USER\My Documents\My Music\MP3s\%artist%\%album%"
(Please change this according to where you want the mp3s saved, this is purely an example).
So again, as long as this music collection contains the artist and album tags, then this will work too.

You can check if your mate's songs contain the correct tags, track, title, artist, and album by opening one of his songs in MP3TAG and seeing if the tags are filled out.
If they are, which they should be, this will sort all you sorting problems out.

So now instead of having either:
Nsongs from your friend
A jumbled up mess of folders and songs to which you can't understand...
You have a whole library worth of sorted and properly named songs!

CAUTION: Before running this Action, please copy the iPods library "iPod:\iPod_Control\Music" to your computer first! If you run this action without copying it first, you will simply move his whole library to your computer and rename, not copy it! This will leave your mate without any music on his iPod.

So pick any place on your PC (eg: C\Temp\Music) and copy it there. Once there, open MP3TAG and drag that music folder into MP3TAG.
Once you have done this, run the action and sit back and watch.

What do I do with the Action once I have downloaded it?
Put it here -
"C:\Documents and Settings\USER\Application Data\Mp3tag\data\actions" (This is a hidden folder, so unhide it first)(Again, this is purely an example, use your logon name instead of 'USER').

You're done. Have fun.


Copy_iPod_Library.mta (170 Bytes)

For those of us wishing to trim leading and trailing spaces, I have found that using the $trim(x) scripting function in a Format Value is the way to go. And it is very simple.

Create a new action of type Format Value.
In the field select Artist or whatever.

In my case I used Artist, so the format string is $trim(%artist%)

That's all there is to it. it will do 15,000 entries in a couple of minutes on my old, slow machine.


AudioBook set up from Filename data

I listen to a lot of audiobooks. Here are some actions I have created that allow me to set up the Track, Title & Album details from the Filename:

The Filenames always tend to look like this, with the same number format, but the audiobook name, of course, will be different for each story:

Another Fabulous Story 001.mp3
Another Fabulous Story 002.mp3
Another Fabulous Story 003.mp3
Another Fabulous Story 004.mp3

Action to create Track Number:

Action: Format Value
Field: TRACK
Format String: $right(%_filename%,3)

(The underscore in %filename% omits the .mp3 part of the filename.)
The track number fields then look like this: 001 002 003 004 etc

Action to create Album Name:

Action: Format Value
Field: ALBUM
Format String: $left(%_filename%,$sub($len(%_filename%),3))
[Edit - Changed from this to the above $left(%_filename%,$sub($strchr(%_filename%,0),2)) ]

The $strchr function searches for the first occurrence of the number zero, and then that characters position has 2 taken off of it to get the length of the filename without the track numbers and the space before the track numbers.

The Album name for each file, in this case, will be:

Another Fabulous Story

Action to create Title Name

I like to the the Title in my MP3 Player beginning with the track number followed by the Album Name.

Action: Format Value
Field: TITLE
Format String: $right(%_filename%,3) $left(%_filename%,$sub($len(%_filename%),3))

[Edit - Changed from this to the above: $right(%_filename%,3) $left(%_filename%,$sub($strchr(%_filename%,0),2))) ]

The Title of each track will then look like this:

001 Another Fabulous Story
002 Another Fabulous Story
003 Another Fabulous Story
004 Another Fabulous Story

I hope someone finds this useful. If you knw of an easier way I could have done any of this,please let me know.

Many thanks for these, they've been quite useful and were nicely written. I took a few minutes to expand the Contraction filter to include missing ones, and added lists for the suffixes that weren't handled. I also added a rule for first letter and compound contractions ('em 'tis, 'twas, 'twasn't, 'tweren't, 'twon't,).

Unelss I missed a few, this will handle just about all of 'em, excluding those pesky ones with corresponding words (she'd, she'll, he'll, i'd, i'm, it's, we'd, we'd, we'll, who're, 'twill, etc.).

I did leave in a few that can cause a false match because the contraction is much more common than the word: can't (cant), won't (wont) It'd (ITD). We're still out of luck on she'd, she'll, he'll and it's --for now. I know i've seen a script to handle that based on context. If I can find it, I'll post it.

Anyway, figured I'd make my first posts helpful instead of questions, and share a copy for anyone who wants it.

What's handled:

ain't, aren't, can't, couldn't, didn't, doesn't, don't, hasn't, haven't, isn't, mightn't, mustn't, shan't, shouldn't, won't, wouldn't, wasn't, weren't, 
   he's, let's, that's, there's, she's, who's, what's, where's, when's, why's, how's,
   that'll, there'll, they'll, you'll, it'll, who'll, what'll, where'll, when'll, why'll, how'll, 
   could've, i've, might've, must've, should've, they've, would've, we've, what've, you've, 
   he'd, how'd, it'd, that'd, they'd, who'd, what'd, where'd, when'd, why'd, you'd, 
   they're, you're, what're, when're, why're, how're, 
   'em, 'tis, 'twas, 'twasn't, 'tweren't, 'twon't

Contraction__Add_Apostrophe__s__Can__t__let__s_.mta (1.09 KB)

1 Like

Newbie question. How do I import the customs actions so they are visible within the mp3tag?


Read there ...


I just recently grabbed MP3TAG to start working with the Album Artist tag. Previously I had used MP3BookHelper (Sourceforge) with great success, but it hasn't had development since 2004 and doesn't support the Album Artist tag.

Perhaps something similar has already been posted, but here's my contribution anyways:

$if(%band%,%band%,%artist%) - %album% (%year%)$if(grtr(%discnumber%,0),$num(%discnumber%,1)-,)$num(%track%,2). %title%

I have a lot of compilations (mix albums). I use this to rename files to the following format:

    \ARTIST - ALBUM (YEAR)\##. TITLE.mp3

On the ARTIST portion however, if there's an "Album Artist" tag (BAND), then I use it, otherwise I use the "Artist" tag.

I have a lot of VA/compilations and this helps with organizing them. For example, for VA album:

    Track: 01 Title: Fallen Angel (Perfecto Mix) Artist: Traci Lords Album: Perfect Remixes Vol 1 Album Artist: Paul Oakenfold Year: 2004

    Track: 02
    Title: Natural Blues (Perfecto Mix)
    Artist: Moby
    Album: Perfect Remixes Vol 1
    Album Artist: Paul Oakenfold
    Year: 2004

    Track: 03
    Title: The Chase (Perfecto Mix)
    Artist: Giorgio Moroder
    Album: Perfect Remixes Vol 1
    Album Artist: Paul Oakenfold
    Year: 2004

Would be:

    \Paul Oakenfold - Perfect Remixes Vol 1\01. Fallen Angel (Perfecto Mix).mp3 \Paul Oakenfold - Perfect Remixes Vol 1\02. Natural Blues (Perfecto Mix).mp3 \Paul Oakenfold - Perfect Remixes Vol 1\03. The Chase (Perfecto Mix).mp3


    \Traci Lords - Perfect Remixes Vol 1\01. Fallen Angel (Perfecto Mix).mp3 \Moby - Perfect Remixes Vol 1\02. Natural Blues (Perfecto Mix).mp3 \Giorgio Moroder - Perfect Remixes Vol 1\03. The Chase (Perfecto Mix).mp3

And when using it for single artist albums, they would use the "Artist" tag. This has allowed me to open up all the MP3s in MP3TAG, Ctrl+A to select them all and quickly rename them in one easy step.

I've created a few for editing my MP3 collection, where my primary player is iTunes and iPhone:

The one I use most has three parts and cleans out all the tags I don't use, and then formats the track tag in the way that I like (removes the slash and total number of tracks on the album part, and any number of leading zeros).


  1. Remove Fields Except > title;artist;album;track;year;genre;picture;itunescompilation;COMMENT ITUNPGAP;UNSYNCEDLYRICS

  2. Replace with Regular Expression > Track > /.* > (nothing)

  3. Replace with Regular Expression > Track > ^0* > (nothing)

If you want to wipe out Lyrics too, remove the field "UNSYNCEDLYRICS".

I just discovered Soundcrank & Fabio's iTunes Lyric Downloader so I'm rethinking keeping lyrics available. Before my tracks that had them were so random and the content so unreliable or full of spam that I cleaned them all out.


This one is handy for renaming tracks from (for example) live albums or remix versions:

It appends the Album Name to the track title in [Brackets] to differentiate it from the original version of the track from the studio album ... so you don't have two files with the same name when using the "Artist - Track Name.mp3" format.

TAG AS ''Artist - Title [Album]'':

  1. Format Value > Title > %title% '['%album%']'


This one might not work for many people who don't think like me.

I name my files in the "Artist Name - Track Title" format. And I sort my music on my phone and in iTunes by Artist, and then by Album (Chronologically), then track number.

Some albums I have (mostly soundtrack albums) I want the album name (not the artist's name) to be the deciding factor when alphabetically sorting; when usually, I don't include the album name in the file name at all.

So this lets me keep specific Soundtrack Albums together, by inserting the Album name into the Artist name field, and appending the actual Artist info to the Track field. My file name will then be in the format "Album [Artist] - Track Title".

TAG AS "Album [Artist] - Title" FOR SOUNDTRACKS:

  1. Format Value > Title > %title% '['%artist%']'

  2. Format Value > Artist > %Album%

I'll usually wind up shortening the Album Name after, but this gets the hard work out of the way.



I've started downloading Lyrics with "Fabio's iTunes Lyrics Downloader" and "Soundcrank".

I've noticed that sometimes complete lyrics don't download, and there is a message about the service not having licensing rights. Well, partial lyrics are useless to me, so I just delete the lyrics tag from all of those.

Also, I've noticed a few sets of lyrics download with large globs of metadata before the actual lyrics. I want to keep the lyrics, but get rid of the metadata.

So: How to Automate this??

I Noticed that in each instance a specific phrase of text is repeated. In the first case, I just set up a regular expression replace as follows:

.Unfortunately, we are not licensed to display.

And I replace it with nothing; effectively blanking the lyrics field. The variables (.*) see to it that all text, both before and after that phrase, are removed.

In the second, I noticed that the metadata ends with the phrase "Ringtone to your Cell" and that the actual lyrics always begin on the next line from this phrase. So I set up another regular expression replace (with nothing) as follows:

.*Ringtone to your Cell...

The Variable (.*) again gets rid of everything up to Ringtone, and the (...) at the end gets rid of line trailing space and line return so that the lyrics start with the new very first character of the tag.

I also set up a third rule so that the Italian language version of "Instrumental." is replaced with the English (the lyrics apparently are archived on an Italian site).

Finally - how to tell apart the tracks with complete lyrics from the tracks with impartial (and now deleted) lyrics from the tracks with no lyrics tag at all??

I added two new columns to Mp3Tag, that I labeled "N" and "B" for "Not Blank" (or just "Blank").

The value for column "N" is "$iflonger(%UNSYNCEDLYRICS%,10,N,)" and column "B" is "$if(%UNSYNCEDLYRICS%,B,)"

What B does is indicate a "B" if a lyric tag even exists.

What N does is indicate if there are any lyrics in it (more than ten characters). So, "B" is a Blank lyric tab and "N B" is a NOT Blank lyric tab.

From there I just sort by N or B and move the files to different folders so I can process getting new lyrics, or scanning through the ones I've already downloaded.

Took me a couple days to figure this stuff out. So I help my system gives you ideas on how you can use Mp3Tag's advanced features in your own work flow! Blue skies!



Clear_Extraneous_Tag_Data.mta (190 Bytes)

Trim_Leading_Zeroes_from_Track_Numbers.mta (41 Bytes)

Trim_Total_Tracks_from_Track_Numbers.mta (41 Bytes)

Tag_as_Gapless_Album.mta (41 Bytes)

Remove_Gapless_Album_Tags.mta (36 Bytes)

Tag_as_Compilation_Album.mta (42 Bytes)

Remove_Compilation_Album_Tags.mta (37 Bytes)

Tag_as_____Album__Artist____Title____.mta (85 Bytes)

Tag_as_____Artist___Title__Album_____.mta (50 Bytes)

Delete_Partial_Lyrics__But_Keep_Tag.mta (233 Bytes)

Remove_Lyrics_Tag.mta (34 Bytes)

Use the following to avoid steps 2 &3:
Format Value > Title > %title% '['%artist%']'

Or use Guess Values to do it all in one step:
Action: Guess Values
Source Format: %title% '['%artist%']' XXXXX %album%
Guessing Pattern: %title% XXXXX %artist%

Doh! Thanks. I fixed my post. And fixed Attachments.

Thanks for the actions. I like the one where the beginning zero is removed from the track number. Very handy. Now if only there was a default 'blank' setting for the 3 bottom fields. The [album artist, composer and disc number]. I wish they had a blank default setting. I have to do it manually.

I came up with a good action that takes the tag values, and renames the files appropriately. Sometimes this is good when the song order was wrong.

$if($len(%track%),$num(%track%,2) -,)$if($len(%artist%),%artist% -,)$if($len(%album%), %album% -,) %title%

This will create a filename is the following format:

Track Num (if exists) - Artist (if exists) - Album (if exists) - Song Title

Just thought I'd share. :rolleyes:

Here is a 'Format value' action, which set up a tag-field FILENAME_NEW from tag-fields TRACK, ARTIST, ALBUM, TITLE in a dynamically way.
A not existing tag-field will not be used to create the new filename.
At least one of those tag-fields should be exist, otherwise the new filename will be empty, that means, FILENAME_NEW will not be created.

The action formatstring uses the '[...] square bracket clamb' operator to check the existence of a tag-field and the '$trimLeft' function to remove unwanted leading space and hyphen characters.

Actiontype 5: Format value

$trimLeft([$num(%TRACK%,2)][' - '%ARTIST%][' - '%ALBUM%][' - '%TITLE%],' -')

The result can vary ...
01 - album
01 - album - title
01 - artist
01 - artist - album
01 - artist - album - title
01 - artist - title
01 - title
album - title
artist - album
artist - album - title
artist - title

The following modified Formatstring creates a value even when all given tag-fields are empty ...

$if2($trimLeft([$num(%TRACK%,2)][' - '%ARTIST%][' - '%ALBUM%][' - '%TITLE%],' -'),$num(%_counter%,2)' - Unknown')


I see someone posted an action to remove leading zeros from track numbers using a regex. Here's a simpler way that also cleans up other common cruft in track number fields.

Action type: Format value
Field: TRACK
Format string: $fmtNum(%track%)

This will change any of the following:

05 -> 5
0006 -> 6
7a -> 7
8/12 -> 8
9 of 12 - > 9

I have three different "first name, last name" action groups, depending on the artist's name.

First, copy ARTIST into ARTISTSORT:

Action type: Format value
Format string: %artist%

  1. The standard one that I'm sure everyone has seen, used for simple names with a single word in the last name.

    Frank Sinatra -> Sinatra, Frank
    Stevie Ray Vaughan -> Vaughan, Stevie Ray

    Action type: Replace with regular expression
    Regular expression: ^(.+)\s(.+)$
    Replace matches with: $2, $1

    [ ] case-sensitive comparison
  2. One for artists with two or more words in the last name.

    Townes Van Zandt -> Van Zandt, Townes
    Miguel De La Bastide -> De La Bastide, Miguel

    Action type: Replace with regular expression
    Regular expression: ^([^\s]+)\s(.+)$
    Replace matches with: $2, $1

    [ ] case-sensitive comparison
  3. And one for names with suffixes such as Jr., Sr., etc.

    Harry Connick Jr. -> Connick, Harry Jr.
    Hank Williams III -> Williams, Hank III

    Action type: Replace with regular expression
    Regular expression: ^(.+)\s([^\s]+)\s(.+)$
    Replace matches with: $2, $1 $3

    [ ] case-sensitive comparison

Here's another for helping me keep track of which .mp3 files have lyrics and which still need to be updated with them:

A custom Column named "Lyrics" that returns "Yes" if Lyrics are found, or "No" if the Lyrics tag (%UNSYNCEDLYRICS%) exist but is blank (except for the language identifier) because of the clean up steps I performed with the Actions I posted above to get rid of only partially downloaded lyrics.

If the %UNSYNCEDLYRICS% tag does not exist at all, the "Lyrics" column remains blank.

Put this in the "Value" field of your custom "Lyrics" column:


I also recently discovered that Mp3tag's column browser can sort by Multiple tags at once.

If you like your your music sorted by Artist first, than by all Albums Chronologically, and then in order by Track number, add this string to the "Sort By" field of the "Album by Artist, Year & Track" column you create:

%artist% - %year% - %album% - %track%

I was blown away when something so simple as that worked.

Now all my artists are listed alphabetically, but within a single artist, each track is listed in the order it appeared on its given album, and more importantly, with the albums listed in the order the albums were originally released. Sweet!

Be aware that such a sorting expression, which is a combination of content from multiple tag-fields, does not sort correct in all cases.
See also:
Sort by file name then by track number


I don't use those three fields either so I delete all the info from them whenever I use my "Clean Extraneous Tag Data" action; which deletes every tag that isn't specifically preserved by the action's instructions.

I'm sure you could create an action to purposefully blank those three fields from all your music files pretty much the same way.

Neat! This little program is so clever!