tell application "iPhoto" -- this script provides automtic numbering of photos in the current album -- in order to provide correct manual sorting, when burning a CD or DVD; -- export sorting by title matches the manual sorting after applying the script get albums set renamedNumber to 0 set thePhotos to (photos of current album) set sizeAlbum to the count of items in thePhotos repeat with i from 1 to sizeAlbum set oldPhotoName to the name of item i of thePhotos set prefixName to "" if i < 1000 then set prefixName to "0" & prefixName end if if i < 100 then set prefixName to "0" & prefixName end if if i < 10 then set prefixName to "0" & prefixName end if set prefixName to prefixName & i & " - " set alreadyNumbered to true repeat with j from 1 to 4 if character j of oldPhotoName is not in {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} then set alreadyNumbered to false end if end repeat if (" - " is not (characters 5 thru 7 of oldPhotoName as string)) and not alreadyNumbered then set the name of item i of thePhotos to prefixName & oldPhotoName set renamedNumber to renamedNumber + 1 end if end repeat display dialog "" & renamedNumber & " photo(s) renamed." giving up after 5 end tell