mwaf
08-06-2003, 01:45 PM
The week before last week I had a kernel crash which destroyed my iTunes 4 Music Library file (cut it in half). Norton was unable to recover it or a complete temp file so I figured I was lost. I had almost setteled with a backup from June when I realized the XML (which was intact) includes Rating, Play Count and Last Played information (the only stuff I really cared about restoring). Unfortunately, iTunes, for some strange reason, is only capable of importing the Rating value of those three. Knowing how to artificially increase the play count I figured an AppleScript could do it. I was in fact directed to this AppleScript at Doug's AppleScripts for iTunes (http://www.malcolmadams.com/itunes/scripts/scripts09.shtml#increaseplaycount) . However, that script didn't actually solve the problem since manually adding the play count to each track would be an immense task. Also, it came without source ;) so I couldn't modify it either.
Instead, I decied to learn AppleScript myself and do what's needed. While my AppleScript skills weren't sufficient to do it in AppleScript alone I did manage to restore my Play Counts (Last played still remains unimported and not as important) using a combination of Shell srcipting, Perl and AppleScript. Confusing as it may sound, it works, which is really everything it has to do.
Now since I did get some useful tips form this forum and elsewhere, I think it would be unfair to keep the script for myself. So feel free to download 'iTunesPlayCountImporter' (http://www.niksula.cs.hut.fi/~jkrogell/ipci.tar) (StuffIt will open that just fine, naturally, tar -xf ipci.tar will also do the trick). It's GPL (http://www.gnu.org/licenses/licenses.html#GPL) if anyone is intrested.
Let me know if you actually use it.
Also, if anyone knows a faster way to add play counts than with 'delay 1' then please tell me.
Instead, I decied to learn AppleScript myself and do what's needed. While my AppleScript skills weren't sufficient to do it in AppleScript alone I did manage to restore my Play Counts (Last played still remains unimported and not as important) using a combination of Shell srcipting, Perl and AppleScript. Confusing as it may sound, it works, which is really everything it has to do.
Now since I did get some useful tips form this forum and elsewhere, I think it would be unfair to keep the script for myself. So feel free to download 'iTunesPlayCountImporter' (http://www.niksula.cs.hut.fi/~jkrogell/ipci.tar) (StuffIt will open that just fine, naturally, tar -xf ipci.tar will also do the trick). It's GPL (http://www.gnu.org/licenses/licenses.html#GPL) if anyone is intrested.
Let me know if you actually use it.
Also, if anyone knows a faster way to add play counts than with 'delay 1' then please tell me.