applescript Add time to selected photos on photos.app
Hi i tried to create a script to add some minutes to selected photos in photos.app
But i have a random error on handler.
display dialog "Give me number of minutes to increment" default answer ""
set timeIncrement to text returned of result as integer
tell application "Photos"
activate
set imageSel to (get selection)
set counter to 0
if imageSel is {} then
error "Please select some images."
else
repeat with im in imageSel
tell im
set tmp_date to its date
set new_date to tmp_date + (timeIncrement * minutes)
set counter to counter + 1
set its date to new_date
delay 0.1
end tell
end repeat
end if
return "Adjusted the date and time of " & counter & " photos."
end tell
What is the problem?