Just a note to say thanks to Leonie, this has helped me no end.
I also wanted to help others, so here is my slightly modified version. The changes I've made are to append an index number to the title (Title - 1, Title - 2, Title - 3, etc..) and to set title, name and description to the 'New' title.
on run {input, parameters}
-- batch change the description to the input
set IndexNo to 1
set NewTitle to input
tell application "Photos"
activate
with timeout of 3000 seconds
set imageSel to (get selection)
if imageSel is {} then
error "Please select some images."
else
repeat with im in imageSel
tell im
set NewTitle to input & " - " & IndexNo as string
set the description to NewTitle
set Title to NewTitle
set the name of im to NewTitle
set IndexNo to IndexNo + 1
end tell
end repeat
end if
end timeout
end tell
return input
end run
Once again all thanks to Leonie.
Oh, and if Photos stays focussed during the renaming operation, it seems to help reduce the scripting errors???