applescript folksonomy (genre tagger)

    • nautisch sa...
    • Användare
    • 12 maj 2009, 14:47

    logfile update

    another minor update:

    -double tags are reduced to only one tag
    -scripts logs to logfile (update USERNAME in line 273 and "chmod 777 log.txt" if it does not work....

    have fun...

    • nautisch sa...
    • Användare
    • 27 maj 2009, 13:59
    unfortunately i just found out that i used sylvère's first version as a base for my updates, therefore no artistfallback in my version so far.

    going to merge s's new versions with my updates sometime soon...

    • jens1245 sa...
    • Användare
    • 10 aug 2009, 22:47

    Multiple tags

    Would it be possible to assign a certain track multiple tags.

    Like acoustic, singer-songwriter, rock

    Btw. The script is amazing.

  • Thank you!

    I'm using your script on itunes 9. Most of the songs in my library (about 50000) didn't have a genre until you came up with your script!
    Big thanks for that!

  • Version 1.5

    I merged the two versions of nautisch and sstoermann.

    Here's the download:


    * minor merge release by loserratio on 09/16/2009 -
    - merge of nautisch's and sstoermanns releases
    - artist fallback + logging + performance upgrades

  • Version 1.6

    * release by loserratio -

    - fixed artist Fallback Bug
    - now also removes chars: <>` from title and artist name which ended up in an script error

    Download: lastfm_tagger_v16

  • Version 1.7



    * release by loserratio on 09/18/2009 -

    - migration to Snow Leopard

    Download: lastfm_tagger_v17

  • Re: Version 1.7

    loserratio said:


    * release by loserratio on 09/18/2009 -

    - migration to Snow Leopard

    Download: lastfm_tagger_v17

    Currently letting it loose on my iTunes library - this tool is so helpful, thanks! :) One thing I've noticed though, remember to change the username in lastfm_tagger_helper.php or you'll encounter a php error as the script tries to write to the log file in a location that probably doesn't exist on your machine;

    $fp = fopen("/Users/loserratio/Library/iTunes/Scripts/log.txt", "a"); .

    Might want to fix that or make mention of it in the readme.

    Apart from that - friggin' awesome job, thanks so much! :)

    • nautisch sa...
    • Användare
    • 4 okt 2009, 21:14
    sweet, i somehow forgot about the script and just read about all the updates u hacked so far (thx, theres no way for me right now to merge anything etc..)

    going to give it a try any time soon.

    btw: i have some more ideas listed somewhere, i'll post them as well, maybe someone wants to work on them...

    10mins later: screw it, just tested 1.6 (still running leo)
    works quite fine...

    - note in logfile (comments too?) if tags are a result of an artist fallback
    - somehow improve the selection process for valid tags. so far pretty much is implemented but the selection still is... well... there's room to improve that
    e.g. download all tags of a track to a local DB and implement some sort of self-learning script that realizes e.g. that AC/DC aint no metal.....
    - work on the toptrack feature (instead of using a fixed numer, default=15 , calculate that depending on number of tracks released by the artist overall)

    my 2cents ;-)

    • soffal sa...
    • Användare
    • 20 nov 2009, 12:43
    is there any possibility to use the script on a pc?

    • nautisch sa...
    • Användare
    • 22 nov 2009, 14:23
    you can certainly use the php file that does all the actual work i.e. filtering etc but you would need to write some code that uses the php file because the applescript (obviously) does not work on a pc.

    there are some similar plugins for e.g. winamp that you could use instead.

    in case you should somehow manage to integrate the php provided here, please keep us updated...

  • Issue with version 1.7 and genre


    I downloaded version 1.7 of your iTunes Tagger, and I'm having an issue with it.

    All of the Genre fields are being filled in with:

    " Notice: Undefined variable: tagList in Library/iTunes/Scripts/lastfm_tagger_helper.php on line 236 Notice: Undefined index: balkan in Library/iTunes/Scripts/lastfm_tagger_helper.php on line 236 Notice: Undefi"

    Any ideas what I might be doing wrong?


  • Version 1.72


    * release by loserratio on 12/12/2009 -
    - path to logfile is generated dynamically

    Download: lastfm_tagger_v172

  • Comments on Version 1.72

    Hey Comrades!

    Version 1.72 tries to address the two issues reported by ObjectMethod and BeauGiles. The php debug message should be ignored now while the path to the logfile is generated dynamically.
    @nautisch: thanks for ideas on the script. Let's have a look at them when one of us has the time to implement the improvements. Eventhough this one sounds pretty sophisticated:

    e.g. download all tags of a track to a local DB and implement some sort of self-learning script that realizes e.g. that AC/DC aint no metal.....

    Best Regards!

  • Thanks!

    Thanks for the update!

    However, even with v1.72, I still seem to be getting the following error:

    Notice: Undefined variable: tagList in /Users/richardpaulguy/Library/iTunes/Scripts/lastfm_tagger_helper.php on line 238 Notice: Undefined variable: tagList in /Users/richardpaulguy/Library/iTunes/Scripts/lastfm_tagger_helper.php on line 238 Cover

  • 1.72

    I will try to fix this bug this evening.

    • tikilab sa...
    • Användare
    • 29 dec 2009, 08:30


    Thank you, this script works great.

    The only bug I can find is when I change $fallbackToArtistTopTags = false; it causes an error and all the genres are tagged with this text:

    Warning: array_unique() expects parameter 1 to be array, null given in /Users/thomas/Library/iTunes/Scripts/lastfm_tagger_helper.php on line 312 Warning: implode(): Invalid arguments passed in /Users/thomas/Library/iTunes/Scripts/lastfm_tagger_helper.

    • [Raderad användare] sa...
    • Användare
    • 16 feb 2010, 00:36


    Hey. I know very little about scripts, but I've been looking for this for years now. I keep getting an error whenever I try to run the script; "could not open input file", and it points to the PHP file. All my permissions are CHMOD 777-ed out, so I'm lost. I enabled PHP and websharing on snow leopard and all that goodness just incase that was the problem, but it wasn't...

    any ideas?


  • Awesome!

    I absolutely love this script! Thanks so much to everyone who worked on it and perfected it! I added a simple little bit of code at the end (right before the text log is written in the php_helper file) so that the script would only tag certain specified genres, but leave the stuff it doesn't use in the tag-cloud unaffected (for example, I don't want the genre of my music to be "fun", but I wouldn't mind keeping that information in the tag cloud for smart playlists). This is my first time delving into PHP, so tell me if my code is doing anything strange!

    here it is:

    $genreGroupings = array() //put your list of genre "keepers" in here.
    $genre = '';
    foreach ($tagList as $index => $tag) {
    if (in_array($tag, $genreGroupings)) {
    $genre = $tag;

    //then modify the echo line at the end so it reads that the genre value, before the first separator, is set to $genre.

  • Re: Help!

    WreckedMyJeep said:
    I keep getting an error whenever I try to run the script; "could not open input file", and it points to the PHP file.

    This happening for me as well, except it only makes it as far as my username folder.

  • Thanks a lot, this is awesome! It's now sloooowly working its way through my library. 12815 tracks with no indication of progress aside from tailing the logfile, this might take a while... - minimal stuff.
    • amiantos sa...
    • Användare
    • 7 apr 2011, 19:07
    This script is amazing. It's kind of weird that it tags individual tracks differently within an album, and I wish it didn't do this, but over all it works great! Thanks so much.

    Everything was beautiful and nothing hurt.
    • spookyt sa...
    • Användare
    • 11 jul 2011, 07:15
    The script is great, but I also find the album thing strange. So if no one answers, I'll try to hack that functionality in by myself.

  • [spam]


    Redigerad av Ziomek2000 den 20 jul 2011, 17:11
    • t-spoon sa...
    • Användare
    • 8 sep 2011, 01:54
    wow. i have been away from this for so long. I can't believe that this thread is still going so much later!

Anonyma användare kan inte skriva inlägg. Vänligen logga in eller skapa ett konto för att göra inlägg i forumen.