iTunes Explicit Lyrics tagging

Over in the comments of my EvilLyrics post, somebody asked for this script. It seems like people might find it handy, so here you go: explicit.txt

It will search the lyrics of all the songs in iTunes for “bad words” and flag those tracks as Explicit by adding the word “Explicit” to the end of the comments in the track.

Now, I have no use for this personally, but I can see where some people might. One thing you will have to do in order to use it is to edit it and define what you consider to be a “bad word”. Just after halfway through the script, there’s a section that looks like this:

badword1|badword2|badword3

Change that to define everything you consider to be a bad word. To use George Carlin’s famous example: shit|piss|fuck|cunt|cocksucker|motherfucker|tits

Just add as many words as you like, then run it like all the rest of these iTunes Javascripts. It’s reasonably smart and won’t tag a track as Explicit if the word Explicit is already in the comments.

You could use this for Smart Playlists, to make “clean” playlists, or to make “not so clean” playlists. Whatever you like. You could do that without this script too, but this makes it a bit easier.

0 thoughts on “iTunes Explicit Lyrics tagging”

  1. I just got my 2000t and all of my songs are skipping in iTunes, and I cant figure out why. If someone could help me out and tell me how to fix this I would really appreciate it because its driving me crazy. Thanks for the replys.

  2. Hi Otto,

    Have come across your website linked to a number of posts on iTunes and Javascript. You have some excellent examples. All of them seem to work with the library and I am finding it difficult to learn how to actually access the iPod through Javascript. We have two iPods and a large library that will not fit on either. So, we use manual song management and it has been difficult to keep track of what song is on which iPod. What I am looking for (or trying to create myself) is a .js that will create a playlist of the entire contents of the currently connected iPod. We have one that is flakey and has needed to be restored a few times and with this Playlist it would be easy. Any hints???

  3. Scott:
    While the iPod is plugged in and in manual mode, it’s a source that can be accessed. You can find it by doing something similar to this:

    var iTunesApp = WScript.CreateObject(“iTunes.Application”);
    var sources = iTunesApp.Sources;
    var numsources = sources.Count;
    var iPodSource;
    for (i = 1; i < = numsources ; i++)
    {
    var kind = sources.Item(i).Kind;
    if (kind == 2)
    {
    iPodSource = sources.Item(i);
    break;
    }
    }

    Basically you just search through the sources looking for the one with a Kind of 2. Once you have the correct Source, then it’s just like the LibrarySource, it has playlists, tracks, etc.

    All this is documented in the iTunes COM SDK. Google for it.

  4. Thanks Otto.

    I have been trying to work with this and was able to count the number of playlists on the iPod, the name if the ipod connected, and the version number but beyond that I have been stumped. I downloaded the SDK but I am having real trouble deciphering how things work. Are you sure that you can acutally access the playlists and tracks ON the iPod? It would make sense that you could not (copy protection)

    Here is the (very basic) code I have been able to decipher so far. Please be gentle, I know NOTHING about javascript. All of the .echos are to help my figure out what is going on. There are VERY few examples available, and NONE that actually try to access the connected iPod.

    var iTunesApp = WScript.CreateObject(“iTunes.Application”);
    var sources = iTunesApp.Sources;
    var numsources = sources.Count;
    var iPodSource;

    for (i = 1; i

  5. You absolutely can access the tracks and playlists on the iPod. Make sure that you put it in manual syncing mode first, however. Not sure if that’s required or not, but it makes sense that you cannot alter anything directly unless it’s in manual mode.

    Here’s a version of the “No Artwork Playlist” script that I made for the iPod:

    var ITSourceKindIPod = 2;
    var iTunesApp = WScript.CreateObject(“iTunes.Application”);
    var s = iTunesApp.Sources;
    var i;
    var ipod = 0;
    for (i = 1; i< =s.Count; i++)
    {
    if (s.Item(i).Kind == ITSourceKindIPod)
    ipod = i;
    }
    if (ipod != 0)
    {
    try {
    var source = s.Item(ipod);
    var tracks = source.Playlists.Item(1).Tracks;
    var numTracks = tracks.Count;
    NoArtPlaylist = iTunesApp.CreatePlaylistInSource("No Artwork", source);
    for (i = 1; i <= numTracks; i++)
    {
    var currTrack = tracks.Item(i);
    if ( currTrack.Artwork.Count == 0 )
    NoArtPlaylist.AddTrack(currTrack);
    }
    }
    catch(er)
    {
    WScript.Echo ("Error trying to create playlist on iPod.. Are you sure it's in Manual mode?");
    }
    }
    else
    {
    WScript.Echo ("No iPod found connected");
    }

  6. Thankyou so much for posting this code. This helped me quite a bit but there must be something else about the way tracks are indexed/linked that is still getting in the way. I can create a playlist of all songs in the main library OR the iPod but not make a playlist of the songs ON the ipod that gets stored in the main library. There are programs that will let me copy the music files and playlists but all I really need is a RECORD of the songs and playlists from on ipod so that I can restore them to my iPod if it decides to crap out (which it does fairly often). Any suggestions?

  7. I can create a playlist of all songs in the main library OR the iPod but not make a playlist of the songs ON the ipod that gets stored in the main library.

    You’re right. You can’t do that.

    Internally, a “playlist” is nothing more than a list of pointers to the songs in the main library. This holds true whether it’s on the iPod or in iTunes. So you can’t make a playlist of songs in iTunes that points to songs on the iPod. That would not make any sense internally, and iTunes can’t do anything like that.

    If you want to save the list of songs and playlists, save them to an external file as text or something like that.

  8. Thanks for all of your help. I gave up and downloaded a program. iPod Access has this feature and I was able to pull the playlists off with it.

Leave a Reply to Scott Cancel reply

Your email address will not be published. Required fields are marked *

css.php