Skip to content

Instantly share code, notes, and snippets.

@xen
Created August 27, 2013 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xen/6359857 to your computer and use it in GitHub Desktop.
Save xen/6359857 to your computer and use it in GitHub Desktop.
tell application "iPhoto"
set curPhotos to selection
set theCount to 0
repeat with thisPhoto in curPhotos
set theCount to theCount + 1
get theCount
if theCount = 1 then
set lastPhoto to thisPhoto
else
if (width of thisPhoto = width of lastPhoto) and (height of thisPhoto = height of lastPhoto) and (date of thisPhoto = date of lastPhoto) then
set thisSize to size of (info for (image path of thisPhoto as POSIX file))
set lastSize to size of (info for (image path of lastPhoto as POSIX file))
if thisSize ≥ lastSize then
set comment of thisPhoto to "duplicate"
else
set comment of lastPhoto to "duplicate"
end if
end if
set lastPhoto to thisPhoto
end if
end repeat
beep
beep
display alert "All duplicate photos have been marked DUPLICATE"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment