Here's the code:
tell application "iPhoto"
-- activate -- bring iPhoto back to front
copy (my selected_images()) to these_images
if these_images is {} then error "Please select some images before using this script."
set thename to ""
set thepaths to ""
set thedates to ""
repeat with i from 1 to the count of these_images
set this_image to item i of these_images
--set this_file to the image path of this_image
set thename to thename & ", " & the title of this_image
--set thepaths to thepaths & the image path of this_image & ", "
set thedate to the date of this_image
set theyear to the year of thedate
set themonth to my format(the month of thedate as number)
set theday to my format(the day of thedate)
set theseconds to my format(the seconds of thedate)
set themins to my format(the minutes of thedate)
set thehours to my format(the hours of thedate)
set thetitle to theyear & "-" & themonth & "-" & ¬
theday & "-" & thehours & "." & themins & "." & theseconds
--set thedates to thedates & thetitle & ", "
set the title of the item i of these_images to thetitle as string
end repeat
end tell
on selected_images()
tell application "iPhoto"
try
set these_items to the selection
if the class of item 1 of these_items is album then error
return these_items
on error
return {}
end try
end tell
end selected_images
on format(thenumber)
if (thenumber as number) < 10 then
set res to "0" & (thenumber as string)
else
set res to thenumber as string
end if
return res
end format
[robg adds: This worked as described in both 10.5 and 10.6. I modified the save path in the hint to include the Applications sub-folder, which forces the script to the top-level of the AppleScript menu. If you'd rather have it in an iPhoto sub-menu, save it into an iPhoto folder directly in the Scripts folder.]

