You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

Changing Photos Titles via AppleScript

I like to add titles to every image by hand in Apple Photos. I prefer to do it when the image is filling the window, not as thumbnails. In this mode, it's really tedious to use the Get Info pane. I have to click back and forth between the image (hitting the arrow key to advance to the next image) and back to the Get Info pane to set the title.


A friend of mine wrote a little AppleScript for me that allows me to select a bunch of photos and then enter names and hit the enter key to advance to naming the next photo. The only problem is that it doesn't show me which photo I'm naming (doesn't bring them up as large photos) so I easily get confused.


I've been hunting for a way to tell AppleScript to open the image up and then advance. Here's the script:

tell application id "com.apple.Photos" -- Photos

set selectedPhotos to selection

repeat with i from 1 to count selectedPhotos

set thisPhoto to itemi of selectedPhotos

display dialog "Enter the name of this photo and say ’Thank you, Ray':" default answer ""

set thisName to text returned of result

set name of thisPhoto to thisName

end repeat

end tell

I've tried telling System Events to press the space bar (with key code 49) but that didn't work to open up the image. Of course I need to advance too...


Ideas?

Posted on Aug 13, 2017 11:02 PM

Reply
1 reply

Aug 14, 2017 4:50 PM in response to Allison Sheridan

After searching this for 3 days on my own I finally enlisted my friend Dorothy to help, and on a wild guess she used "spotlight" as the command to open up each image. It works.


tell application id "com.apple.Photos" -- Photos

set selectedPhotostoselection

repeat with i from 1 to count selectedPhotos

set thisPhototoitemiofselectedPhotos

spotlight thisPhoto

display dialog "Enter the name of this photo and say ’Thank you, Ray':" default answer ""

set thisName to text returned of result

set nameofthisPhototothisName

end repeat

end tell

Changing Photos Titles via AppleScript

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