Created
August 27, 2013 22:13
-
-
Save xen/6359857 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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