Better iTunes song deduping
I’m happy to share my hacked version of Doug Adams Corral iTunes Dupes AppleScript. You can grab my version from here.
His version uses some wicked fast PERL to find all the duplicate songs based on info in the Library, and then puts them all in a Dupes playlist. However, I wanted to filter by Name, Artist, and Album, and have a single playlist where I could delete in one fell swoop all the duplicates. So I tweaked his AppleScript to have another prompt that asks if you want all dupes to go in the playlist, or just copies 2…X to go in.
I run it once with “All” to make sure I have what I want, and then rerun it with “Just Dupes” and build the playlist of files to delete. Works great, and I’m mailing him a copy, maybe it’ll be in the 1.1 version!
I was also very happy with the application Seek and Destroy Music Duplicates. It is written in Java using WebStart, and gave some good results as well. It is better in that you can pick which copy of the duplications you want to keep, and color codes each set of duplicates.
The tool iDupe really didn’t do that much for me, and the demo is limited to just doing 3 deletes. Seek and Destroy is a better choice.
February 3rd, 2007 at 3:18 pm
where can I get your de-duping script? the link is broken. sounds like it’s exactly what everyone needs
February 5th, 2007 at 2:48 pm
I’ve updated the links in this blog post. Sorry about the confusion, this was caused by a revamp of our blog system and web site.
February 7th, 2007 at 4:33 pm
The script wants to run in Classic. Did I do something wrong?
Also, the mac os x folder is empty … ?
February 7th, 2007 at 5:32 pm
Aha — tried something other than Stuffit — alles gut/
April 25th, 2007 at 4:03 pm
Jim dropped me a note with this question:
_After running your program, it creates the
“dupes” playlist with all the dupes. Now that I have
these in a playlist, is there anyway that I can
actually have the dupes removed from the itunes
library? When I select all in the dupes playlist and
hit delete, it just deletes this playlist and i still
have the dupes in my library._
To actually delete the underlying files, you need to hold down the option (or is it control??) key. ITunes will ask you if you want to delete the actual files, and you click “Yes”. Drove me crazy for a while as well.
May 5th, 2007 at 8:05 pm
Excellent! Works perfectly, I had around 1600 duplicate files due to a transfer to a new computer, m3u files, and general forgetfulness. THE most important script I have on my computer.
May 15th, 2007 at 12:26 am
[…] Finally I came accross this applescript, and it does precicely what I want. (and what I imagine everyone with this problem wants): finds duplicate songs according to user-specified metadata dimmensions, and put “all but one” of each file in a playlist. Select all, option delete, DONE. […]
May 17th, 2007 at 9:50 am
Do you have anything that will run on a pc?
July 10th, 2007 at 9:37 am
Late to the party here but this is EXACTLY what I needed! Thank you.
July 10th, 2007 at 4:20 pm
Ok so I’ve got the dupes playlist. How do I delete the FILES? not just the entires in the Library?
Cheers
c
July 26th, 2007 at 12:54 am
To answer Craig’s: the best way i think is to add a comment to all songs in the dupe playlist (select all -> show info), then sort by that column and delete all the songs with that particular comment. Example: ‘ * ‘ as a comment.
August 31st, 2007 at 8:54 am
got 6000 duplicates, so this script is heaven 4 me!!! THANKS
(ps: i just renamed all the artist names in the dupes list to ‘jsdhdgfsdjkjgvks’ and then deleted those in the library
December 24th, 2007 at 10:50 pm
Nice contribution. I’m puzzled though, when you’ve expanded on someone else’s work (and indeed contributed a patch to them), why did you not allow access to your script inside the app? I would much rather have just downloaded the script than an app, or an app where I can get at the script. I want to see the code before I run it, and possibly tweak it for my own needs. I think I’ll just get Doug’s script.
December 24th, 2007 at 11:01 pm
Ah, I see that Doug packaged the script in the same way, and that I can open these apps in the Script Editor. I’m new to Applescript - my bad, my apologies.
January 6th, 2008 at 7:22 am
[…] OpenSource Connections » Blog Archive » Better iTunes song deduping nice deduper (or cover song finder!) (tags: itunes applescript) […]
January 20th, 2008 at 11:38 am
Totally amazing script, I found the best results where returned when I filtered the Dupes for ‘Size’ rather than name or albumn. That way you can make sure the ones that are the same size i.e. same song (regarless of albumn or name) are filtered into the Dupes playlist. Thanks to Jim for telling us how to delete tunes directly from a playlist.
January 22nd, 2008 at 5:52 am
So, im currently running your script, its been going for 2 days now, i wish it didnt take so long, but i do have 330 gigs of music it is going through… I’m hoping it ends soon, cause i cant use itunes to put any new music on my iphone or ipods…. Is there a way to end the script and remove the duplicates its found so far… im afraid to force quit itunes and I dont see any other way to quit the script… thanks and if anybody knows how to do that, post a replyon here… also was wondering if anybody tried phelix, and how that compares to removing dupes versus this script… btw thaks a ton for putting in your fine work on this script…
March 3rd, 2008 at 12:06 pm
Yeah - I believe the Size is the best attribute to sort by if you have an extensive collection (which I’m sure everyone does) and have 3 or 4 artists that play the same song name. Excellent Script!
April 20th, 2008 at 5:20 pm
I’ve run into a rather frustrating problem that maybe this script can help fix. I’m re-ripping my library with Apple Lossless and have discovered that iTunes isn’t actually replacing the songs, but making duplicates. Would there be a way to tweak the script to automatically choose the lower bitrate (or at least smaller file) file for the duplicate? I’m sure I could figure it out with a week or two of studying, but if you’re a Perl wiz (and really, the mod should stay in your excellent script), you could probably knock it out in an hour, ya?
May 28th, 2008 at 1:38 am
Months of looking for a solution have come to an end. Eric, this is the best thing that has happened to me in my MacLife so far. Cheers for that.
May 31st, 2008 at 6:19 pm
Thank you very much! This is exactly what i needed!
June 22nd, 2008 at 11:14 pm
Thanks!
Saving me LOTS of time!
In line with Keith’s comment, it would be great to have a cancel option while the script is running (versus force quit the script)
July 3rd, 2008 at 11:53 am
This looks compiled. iTunes does not recognize it as a script, nor does the script editor.
unzip corral-itunes-dupes-eric.zip
open in Script Editor:
unzip corral-itunes-dupes-eric.zip
˛Ì˙Œ
July 17th, 2008 at 7:10 pm
dude. you just saved me about 6 hours of mind numbing manual labour. thanks a million!
September 13th, 2008 at 6:19 pm
i have never used the scripts, so I have no clue how to use this… and i have million duplicates… please advise =)