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

Batch change in Photos?

Seems like Apple has gotten rid of the "batch change" feature from iPhoto when moving to Photos. I liked using the "batch change" feature to change the "description" for several photos at once. Does anyone know how this can be accomplished in the new Photos app (which doesn't include pasting a sentence 200 times)...


Thanks for your response!

Posted on Apr 12, 2015 4:37 PM

Reply
90 replies

May 1, 2015 2:14 PM in response to Dbrillh

Did you select the photos in Photos before you ran the Workflow? Try to select the photos only in one moment or album, and not too many at once. It may be a timing problem.


If the service does not show - did you use the Service template when you created the workflow? Is it in stalled in ~/Library/Services and did you enable it in the System Preferences > Keyboard > Shortcuts ?

User uploaded file

May 1, 2015 3:43 PM in response to léonie

1) Yes, a couple of photos are selected.

2) Upon a system restart, the service showed up in the Photos\ Services menu

3) I still get the same error.

User uploaded file

4) The work flow was created using the Service button on the File/ New action in Automator

User uploaded file

(I couldn't fine the template that you referenced.)

5) the "Photos- Description" service does show up and is enabled in keyboard shortcuts/ Service

User uploaded file


Sorry, I may be a little slow at this. I've programmed various types of computers for 40 some years, but this is the first time I've tried to use Apple Script.

Thanks.

May 1, 2015 4:25 PM in response to Dbrillh

The line you posted looks like it had too many words.


on run {input, parameters}

-- batch change the description to the input

tell application "Photos"

activate

set imageSel to (get selection)

if imageSel is {} then

error "Please select some images."

else

repeat with im in imageSel

tell im

set the description to input

end tell

end repeat

end if

end tell

return input

end run


It should read:
set the description to input

all in lower case letters

May 3, 2015 2:43 AM in response to Dbrillh

and sure enough, the script service works on a smaller library, at least partially. It assigned the descriptor to the first 6 or 8 selected photos, so I submitted a bug report to the Photos for Mac feedback site. (at Apple Feedback pages.)

That suggests a timing error. The timing will depend on the library size.


I hope, the bug report will help and Apple fixes this soon.


How large is the library, that did not work?

We need batch changing particularly for large libraries; scripting is pretty useless, if it will not work on reasonably sized libraries 😟

May 4, 2015 12:51 PM in response to Dbrillh

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???

Jun 6, 2015 4:00 PM in response to mkstevo

It works for me with a small test library, but not with my normal library which has about 15,000 images. I did repair the library (hold Command + Option keys when starting Photos), but the error persists. I tried adding a "delay 1" just prior to "set the description to input", but that made no difference.


Has anyone found a way to make this work on large Photos libraries?

Jun 6, 2015 4:17 PM in response to Kevin Horton3

I did repair the library (hold Command + Option keys when starting Photos), but the error persists. I tried adding a "delay 1"

The scripting errors are less, when the photos are selected in the "AllPhotos" album, and not in Moments or smart albums - unfortunately.

One problem with all the scripts is, that the line "set imageSel to (get selection)" in the Apple Scripts does not work reliably in Photos. It will give random timeouts and works best in the "All Photos" album. Apple needs to fix this to make scripting more reliable. The errors are more frequently with iCloud Photo Library enabled. When I first posted the scripts I did not use iCloud Photo Library.


There is a work-around proposed by NicFletcher: Don't ask for the current selection, but add the photos you want to process to an album with a fixed name.

  • Create an album with a fixed name - mycurrentselection or similar - and add all photos you want to process to this album.
  • Instead of the "get current selection" process the photos in this album.


Here is a sample Apple Script by NicFletcher that uses this method:

https://discussions.apple.com/thread/6999613?answerId=28087786022#28087786022

Batch change in Photos?

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