Share your custom Actions

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?

Thanks

Read there ...
/t/2748/1

DD.20091215.1852.CET

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

NOT:

    \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).

CLEAN EXTRANEOUS TAG DATA:

  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.

===

LYRICS:

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!

==============================================================

PS: I LOVE THIS PROGRAM.

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
Field: FILENAME_NEW
Formatstring:

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

The result can vary ...
01
01 - album
01 - album - title
01 - artist
01 - artist - album
01 - artist - album - title
01 - artist - title
01 - title
album
album - title
artist
artist - album
artist - album - title
artist - title
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')

DD.20110412.1006.CEST

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
Field: ARTISTSORT
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
    Field: ARTISTSORT
    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
    Field: ARTISTSORT
    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
    Field: ARTISTSORT
    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:

$iflonger(%UNSYNCEDLYRICS%,10,Yes,$if(%UNSYNCEDLYRICS%,No,))

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

DD.20110424.2024.CEST

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!

UPDATED 21 May 2011:

I just further updated this because I started using the "AlbumSortOrder" (or "AlbumSort" in the new version) tag to insert chronological info for Artists who release multiple albums or singles in the same year and my OCD wants even THEM to appear in the right order.

I went with a "%year%·1·%album%", "%year%·2·%album%" etc. scheme for artists who I insert the same year chronological detail for manually.

My workflow would thus be to highlight all the tracks from one artists, sort as mentioned below, format the %albumsort% field as %year%·1 for all tracks (as the VAST MAJORITY of all albums ARE the first release of the year by a given artist), and then update the sort number as appropriate for singles or albums that weren't the first item released that year for the given artist, and aren't also alphabetically first. Then, when done, I append the album names on the end, so there is something to keep all the "1973-1"'s from sorting together elsewhere.

Otherwise, I just format the %albumsort% field for all other tracks as "%year%·%album%".

My new sort column script is this:

Sort by: $if2(%artistsortorder%,%artist%) - %year% - $if2(%albumsortorder%,%album%) - %discnumber% - %track%

With the new tag names in version 2.47 and beyond, this would be:

Sort by: $if2(%artistsort%,%artist%) - %year% - $if2(%albumsort%,%album%) - %discnumber% - %track%

($if2 specifies if the ArtistSortOrder or AlbumSortOrder tags are present, use them; otherwise, just use the artist or album name.)

This way I don't have to add Sort Order data manually to EVERY artist in my collection - just the ones I'm really anal about. And since I previously blanked out the AlbumSortOrder tags from all my collection, only the ones I've specifically added it back to will have them, so I know they will be correct.

Love this program more and more every day!

[Edited previously to include Artist Sort & Disc Number tags]

Refined it to this:

$ifgreater($len(%unsyncedlyrics%),5,Yes,$if(%unsyncedlyrics%,No,))