Tag Archives: applescript

iPhoto AppleScript to Remove Duplicates

Update May 6, 2015: This script has not been tested with Mac OS X Yosemite 10.10.3 new Photos application.

Short Story:

I had several years of photos that I needed to identify and remove the duplicate. Instead of manually combing through 12,000 (read Long Story below) and before carpal tunnel set in, I needed a script to help me out. My situation may or may not be unique, so this script may not work 100% out-of-the-box for you, but it should get you started.

This script will identify duplicate photos in your iPhoto library and mark them with a comment (keyword) of “duplicate”. It will not delete anything.

To use:

  1. Download and unzip the script
  2. Double-click the script to open in Script Editor
  3. Go into iPhoto and select a group of photos you want to compare
  4. Switch back to Script Editor and run the script
  5. Don’t Touch Anything! Just let the script finish, it could take a while if you are comparing a lot of photos
  6. After the script is done, go back into iphoto and search for “duplicate”
  7. You can highlight all the duplicates and delete them or move them some place safe

Photos are considered a duplicate if:

  1. both heights match
  2. both widths match
  3. the photo date in iPhoto match, this is typically the EXIF creation date
There are no error checks in this script and it presents no interface except an alert when it’s done. If you need help, just post a comment below and I’ll do my best.

Long Story:

Continue reading

Posted in Mac. Tagged with , .