tell application "iPhoto" activate end tell tell application "System Events" tell process "iPhoto" tell menu bar 1 tell menu "View" --OLDER VERSIONS: If you have the Arrange Photos menu item, -- uncomment (remove the two dashes) the next two lines, and -- comment out the following two lines: --tell menu item "Arrange Photos" --tell menu item "Arrange Photos" tell menu item "Sort Photos" tell menu "Sort Photos" click menu item "by Date" end tell end tell end tell end tell end tell end tell tell application "iPhoto" get albums set theAlbum to current album set thePhotos to (every photo of theAlbum) as list set theCount to count of thePhotos end tell tell application "System Events" tell process "iPhoto" tell menu bar 1 tell menu "View" --OLDER VERSIONS: If you have the Arrange Photos menu item, -- uncomment (remove the two dashes) the next two lines, and -- comment out the following two lines: --tell menu item "Arrange Photos" --tell menu item "Arrange Photos" tell menu item "Sort Photos" tell menu "Sort Photos" click menu item "Manually" end tell end tell end tell end tell end tell end tell tell application "iPhoto" repeat with j from 1 to (count of thePhotos) set newPhoto to id of (item (theCount + 1 - j) of thePhotos) remove (item (theCount + 1 - j) of thePhotos) from theAlbum add (photo id newPhoto) of photo library album to current album end repeat end tell