Duplicate tracks in itunes

I started re-ripping all my hundreds of cds to aac files in itunes and discovered that itunes makes a duplicate entry in the playlist and does not write over the mp3 version of the same track.

So the delima is: can an applescript be written to run through all tracks and move or delete the mp3 version of a track if an aac version exists?

If this is fairly easy, can you point me in the correct direction?

Good Ole Doug Adam’s has a script to perform this task (plus many others) at his web site Doug’s iTunes Scripts. “Remove Duplicates” is towards the bottom of the page.

He also has a great AppleScripts for iTunes forum…

http://ipodlounge.com/forums/forumdisplay.php?s=&forumid=42