Recently, my iPod has been collecting duplicate playlists like a child collects dirt. It’s not an unknown problem. A bit of googling shows that others have had the same issue and as there didn’t appear to be a simple solution, I decided to write a little script to take care of things. The following code deletes zombie playlists from the iPod. After, I re-sync to restore the playlists. This takes only a second because the iPod has already been synchronized before I run the script. Figlet, as you probably might guess, is the name of my iPod.

tell application "iTunes"
	set Figlet to first source whose name is "Figlet"
	set pls to every user playlist of Figlet
	repeat with eachpl in pls
		try
			delete eachpl
		end try
	end repeat
end tell