advertisement

Article:
  Cleaning iPhoto
Subject:   Use the Force, Luke.
Date:   2007-02-15 17:19:36
From:   paulskinner
Response to: Use the Force, Luke.

In this shorter version you're asking Applescript to first iterate through every item in your library and retrieve the properties from each one of them, then compare two values from those properties to your given values. After this you then have it store the items that match the range you test for into a list. It may be storing a reference (memory cheep) or it may store the value (memory expensive) of the database entry.


This is indeed very inefficient despite being concise.


This version is more memory and processor efficient. I ran it against my 22000 image library and checked 5500 in ten minutes.



tell application "iPhoto"
tell photo library album
set c to count of photos
repeat with myIndex from c to 1 by -1
tell photo myIndex
set {thisWidth, thisHeight} to {width, height}
end tell
if thisWidth < 200 or thisHeight < 200 then
remove photo myIndex
end if
end repeat

end tell
end tell


Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Use the Force, Luke.
    2007-04-14 16:59:47  sttkaufman [Reply | View]

    Great applescript thanks. Is it possible to do the "remove duplicate" script written in Perl as an Applescript. That is my real problem. Thousands of dulpcates from merging three semi-duplicate iphoto libraries on three machines. Now I have a mess on my hands. I would like to search for dulpicate images that may or may not have different names, and choose the largest res, keep that one, and throw out the others. Any thought or hints? Any one tried this in AppleScript?

    Stephen
  • Use the Force, Luke.
    2007-02-15 17:26:30  paulskinner [Reply | View]

    I forgot to mention that if you're running iPhoto on an older or lower-powered system you should go to the appearace pane of the iPhoto preferences and turn off drop shadow and outline options for a substantial speed improvement.

    Seeing the dates on this article I hope you're back in the states Brian, but perhaps not... if you're still over there, keep your head down.