Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Tag alphabetizer tool? (Read 4234 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Tag alphabetizer tool?

Helloo foobase,

I'm just diving into tags, and this is a chore.  It would be nice to have a context-menu tool that will do a few things related to alphabetizing, and I'm wondering if it's been written, or could be written by a newb like me.

1) It will remove "The" from the beginning of Artist tags where it exists, and put it at the end, after a comma. (So the tags come out "Twelves, The" or "Pixies, The.")

2) It will put the last word in a tag first, and separate it by a comma from the remainder.  (So from "Ryan Thomas Becker" it gives you "Becker, Ryan Thomas.")

3) It will remove punctuation from acronyms.  (So from "N.A.S.A." it gives you "NASA.")

Thanks a mil.

a.k.a.

Tag alphabetizer tool?

Reply #1
There are two possible ways I know of to accomplish what you want.
Way 1 involves just using the default File Properties dialogue.
Way 2 uses foo_masstag.

Both ways work on all selected songs.
1) remove "The" from the beginning of Artist [...] and put it at the end, after a comma.

In the File Properties dialogue, open the context menu (right click) in the line "Artist Name" and select "Format from Other Fields" and enter $swapprefix(%artist%). Voilà. Pay attention if you have songs that have multiple artist tracks. They will involve further tweaking to automatise the process.
In Masstagger, you can create a so-called script which always executes the action "format field from other values" with the same parameters and is then callable directly through the context menu (and consequently is available as a button or keyboard shortcut).

Quote
2) It will put the last word in a tag first, and separate it by a comma from the remainder.  (So from "Ryan Thomas Becker" it gives you "Becker, Ryan Thomas.")

Same procedure as above, just change the Title Formatting string to [OK, this took me some minutes; remove line-breaks to make it work]:
Code: [Select]
$put(lastword,$right(%artist%,$sub($len(%artist%),$strrchr(%artist%, ))))
$ifequal($len(%artist%),$len($get(lastword)),,
', '$left(%artist%,$sub($len(%artist%),$len($get(lastword)),1)))

What it does: extracts and displays the last word from the tag. Then (beginning at $ifequal) it checks if lastword is already the whole artist name. If not, it displays the rest, separated by a comma.

Quote
3) It will remove punctuation from acronyms.  (So from "N.A.S.A." it gives you "NASA.")

This is easy and difficult at the same time. While a simple $replace(%artist%,.,) would work in the shown example, I don't know how to automatically detect an acronym.

You find all the functions documented in Help > Title Formatting Help.

Tag alphabetizer tool?

Reply #2
Code: [Select]
$put(lastword,$right(%artist%,$sub($len(%artist%),$strrchr(%artist%, ))))
$ifequal($len(%artist%),$len($get(lastword)),,
', '$left(%artist%,$sub($len(%artist%),$len($get(lastword)),1)))

What it does: extracts and displays the last word from the tag. Then (beginning at $ifequal) it checks if lastword is already the whole artist name. If not, it displays the rest, separated by a comma.

another way:
Code: [Select]
$swapprefix(%artist%,$replace($directory_path($replace(%artist%, ,\)),\, ))


Tag alphabetizer tool?

Reply #3
Jeez, it would take me a few weeks to figure out what you guys just did.  Mille mercis.

So, just so I'm clear, how does one use this as a context menu or macro option?  Of course, I don't want it to start renaming every single artist name unless I tell it to.  For instance, these scripts should rename "The Cat Empire" and "Ellie Goulding," but not "Yeah Yeah Yeahs."

Tag alphabetizer tool?

Reply #4
Code: [Select]
$swapprefix(%artist%,$replace($directory_path($replace(%artist%, ,\)),\, ))

Wow, nice hijacking of the $directory_path function. I have to remember this one! You have won this golf match 

a.k.a.: Reread my last post, especially the part 1). In order to apply the procedure there, you might want first to select all tracks by a given artist. To do this easily, a library viewer like album list, facets or filters setup to display your library by artist names is a good idea. Just select all entries of artists you would like to rename, open the file properties dialogue and there you go.

Tag alphabetizer tool?

Reply #5
Quote
another way:
Code: [Select]
$swapprefix(%artist%,$replace($directory_path($replace(%artist%, ,\)),\, ))
Though I love your smart use of $directory_path, I wouldn't recommend it as this will apply on every artist. That means Nine Inch Nails would be Nails, Nine Inch and Yeah Yeah Yeahs would be Yeahs, Yeah Yeah.


 

Tag alphabetizer tool?

Reply #7
I guess that was not a very useful remark, no .