How to use Applescript to find duplicate files and .mp3 files in my iTunes "Music" folder and subfolders? I recently moved my iTunes music library onto a new computer set-up by copying the "iTunes Media" folder onto an external HD and then onto my local disk. When I opened iTunes for the first time, it loaded the cover art for all of my iTunes-purchased content but it displayed the cloud icons for all my music, indicating that it was available to stream but not available offline, and it did not display the music I've imported from CD's at all.

I assumed that my transfer didn't work, so I started downloading my high-priority purchased content again. Well, yesterday I actually went into my "iTunes Media" and "Music" folders, and all of the audio files are there. The high-priority content that I've downloaded again has all duplicated, and the content exists but is not duplicated.

Now I want to clear the duplicate files. I also want to either display the imported and the low priority purchased content in my iTunes library or delete it from my local disk (haven't decided which yet). I'm guessing that some or all of this can be automated with Applescript or Automator, but I've never used either of those before and I need some help. Which tasks can I automate, and what's the best way to learn these utilities if I've done some programming before?
Doug's AppleScripts for iTunes have helped me a great deal. Try Dupin for cleaning those duplicate files. There's also a lite version.

You can learn a lot about AppleScript by opening scripts by others in script editor so you understand what's happening. Apple also has a comprehensive guide about the language, if you want to read all about it.