Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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.

This is my script:

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?

Posted on Jun 27, 2015 9:04 AM

Reply
2 replies

Jun 27, 2015 10:01 PM in response to trippo

The script works as expected for me, so there has to be something specific to your setup that's affecting it.


What error message do you get when you run the script? What line of code (if any) is highlighted?

Does it work for one selected photo? for many? Does it fail on specific photos? or any?


More detail is needed in order to troubleshoot this one.

applescript Add time to selected photos on photos.app

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.