Deleting iTunes Tracks in Perl

Tue Sep 28 2004 08:32 MDT #

So all my audioblogging subscriptions means I have lots of long audio programs that I have listened to and never want to listen to again. Now I could open iTunes and delete them after I listen to them, but that would be too much work.

So I set up a smart play list called "To Delete" that gets all tracks marked 1 star. Then after I listen to something on my iPod, I mark it one start. The next morning at 6am my delete_tracks script runs and the tracks are gone.

I used Mac::Glue to write this sucker, which as it turns out is a lot of work. Basically Mac::Glue lets you do applescript but hides it in perl clothing. The problem here is that it is applescript beneath it all, and I pretty much had to write all the Mac::Glue bits in applescript then translate it into Mac::Glue, to get it to run. And applescript is a bitch. But in the end I did end up with a bit of perl that I'm happy with :) And the script is general purpose enough, takes a playlist name for instance, that it might be useful to someone else.

Add your comments