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.

batch title change in photo version 1

The new "Photo" has changed the user interface completely. Is there a way to to the "batch title change" for a group of photos? There are instructions for how to do for one, but I'm hoping that this has not been lost. I'm using version 1.


Is there any way to remove the conformation that is now required each and every time you want to delete a photo or group of photos?


Thanks,


DMW

Posted on Apr 24, 2015 9:56 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 27, 2017 3:19 PM

Try creating an app from the script and use it from the Dock or from the Scripts folder:

User uploaded file

which is activated in Script Editor's General Preference pane:

User uploaded file

You can download a compiled version of the script as an application from this tutorial site: P01 - Applescripts from Photos’ User Tips Compiled as Applications

User uploaded file

35 replies

Apr 25, 2015 9:26 AM in response to Jay Deitch

Can you change the title of the photos in question manually? Are your photos jpegs? I tested only with Jpeg files.


Or perhaps your Photos library has a corruption.


You can test that by quitting Photos, holding down the alt/options key while launching Photos and selecting to create a new, empty Photos library for testing. Then add a few test images to the library and test there.

Apr 25, 2015 12:19 PM in response to léonie

Hi Léonie,


- Yes, I can change the titles manually by typing them in below the image in the Moment. I can also paste in the new title.

- The photos are all jpeg

- I created a test library and the script works fine so it looks like the library is corrupt. I'm repairing it now. For those of you with similar problems, just hold down the Option and Command keys while starting up Photos to repair the library.


I'll let you know what happens after the repair is finished.


Thanks again for all your help.

-Jay

Apr 26, 2015 9:17 AM in response to Jay Deitch

Hi Léonie,

I found another post of yours about rebuilding the iPhoto Library using iPhoto Library Manager. I tried it (took all night), and it found a few photos that couldn't be imported to the rebuilt library. It looked fine in iPhoto so I opened that library in Photos. I get the same error when running the script. I can't think anything else to try. Maybe I'll just stick with iPhoto.

-Jay

Apr 26, 2015 9:24 AM in response to Jay Deitch

I forgot to include this...


Here are the Console messages I get when I run the script. The first two happen as soon as I open the script. The other three appear after I type in the title text:


4/26/15 11:20:05.227 AM Automator Runner[2841]: -[AMApplicationRegistry loadDefinitionAtURL:]: No application name for definition at URL file:///Library/Automator/Office.definition/

4/26/15 11:20:05.227 AM Automator Runner[2841]: -[AMApplicationRegistry _loadDefinitionsAtURLS:]: Failed to load definition at URL file:///Library/Automator/Office.definition/

4/26/15 11:20:42.006 AM Photos[2832]: An exception was thrown during execution of an NSScriptCommand...

4/26/15 11:20:42.006 AM Photos[2832]: *** -[__NSArrayM objectAtIndex:]: index 47333 beyond bounds for empty array

4/26/15 11:20:42.384 AM WorkflowServiceRunner[2840]: WorkflowServiceRunner received error running Workflow Service at /Users/Jay/Library/Services/Batch Change Titles.workflow: The action “Run AppleScript” encountered an error.


-Jay

Apr 26, 2015 12:37 PM in response to léonie

HI,


With Activity Monitor open, "Activity Runner shows up when I launch the script from the Photos > Services menu. It goes away as soon as I get the error message:


User uploaded file


If I open Automator (with Photos open and the photos still selected), Automator is shown in Activity Monitor and stays there until I close it (as it should). If I execute the workflow from Automator I get a different error message:


User uploaded file


Since the script worked fine with a small, test Photos library, the problem is probably with the default Photos library (which is now named "Default Library (rebuilt)").


I get a nice collection of Console messages while doing this:


4/26/15 2:30:07.615 PM WorkflowServiceRunner[3005]: Failed to connect (colorGridView) outlet from (NSApplication) to (NSColorPickerGridView): missing setter or instance variable

4/26/15 2:30:07.615 PM WorkflowServiceRunner[3005]: Failed to connect (view) outlet from (NSApplication) to (NSColorPickerGridView): missing setter or instance variable

4/26/15 2:30:07.650 PM WorkflowServiceRunner[3005]: -[AMApplicationRegistry loadDefinitionAtURL:]: No application name for definition at URL file:///Library/Automator/Office.definition/

4/26/15 2:30:07.650 PM WorkflowServiceRunner[3005]: -[AMApplicationRegistry _loadDefinitionsAtURLS:]: Failed to load definition at URL file:///Library/Automator/Office.definition/

4/26/15 2:30:07.724 PM Automator Runner[3006]: -[AMApplicationRegistry loadDefinitionAtURL:]: No application name for definition at URL file:///Library/Automator/Office.definition/

4/26/15 2:30:07.724 PM Automator Runner[3006]: -[AMApplicationRegistry _loadDefinitionsAtURLS:]: Failed to load definition at URL file:///Library/Automator/Office.definition/

4/26/15 2:30:16.659 PM Photos[2997]: An exception was thrown during execution of an NSScriptCommand...

4/26/15 2:30:16.659 PM Photos[2997]: *** -[__NSArrayM objectAtIndex:]: index 48158 beyond bounds for empty array

4/26/15 2:30:17.084 PM WorkflowServiceRunner[3005]: WorkflowServiceRunner received error running Workflow Service at /Users/Jay/Library/Services/Batch Change Titles.workflow: The action “Run AppleScript” encountered an error.


The messages at 2:30:07 are from running the workflow from Automator, the others are from running the scrips from Photos > Services.

-Jay

May 3, 2015 3:13 PM in response to Jay Deitch

Hi again,


I was reading through another thread - Where are photo file names? and inverseroom commented (pg. 5): "Wait a minute, I just found that when I select images in the Photos tab, the script won't work, but when I select them in albums > all photos, it does." So I tried that with the script described in this thread (to batch change the titles) and it worked! I've only tried it once, but once is one more time than it has ever worked before for me!


Jay

May 4, 2015 2:31 PM in response to Old Toad

Hi,


I changed the titles on 100 photos in about 30 seconds on a mid 2011 MacBook Air with a 1.6 GHz Intel Core i5 processor.


I'm using Léonie's original script:


on run {input, parameters}

-- batch change the title to the input

tell application "Photos"

activate

set imageSel to (get selection)

if imageSel is {} then

error "Please select an image."

else

repeat with im in imageSel

tell im

set the name to input

end tell

end repeat

end if

end tell

return input

end run



-- Jay


o

Model Name:

May 12, 2015 4:37 AM in response to Jay Deitch

Thanks Jay,

I also copied/made that Applescript, and it worked perfectly.

But today the Automator Service no longer worked, so I built it again. Alas...

Then I came across this text of yours [quote]"Wait a minute, I just found that when I select images in the Photos tab, the script won't work, but when I select them in albums > all photos, it does."[/quote]

And indeed, I switched to Albums>All Photos and it worked.

So I'm a happy camper again.


Is there no way to change the script so that it either switches to Albums>All Photos, or tells the user to do that first?

Aug 26, 2015 9:01 AM in response to Old Toad

As stated in another post the script will work when run on pictures selected in Albums > All Photos. While this is helpful it isn't entirely helpful for me. Is there a way for the script to work within a particular Album? I have several pictures perhaps from different times all in one album. It's not feasible for me to select these pictures in Albums > All Photos to do the batch rename. Instead it would make sense to select all within the album.


Thank you all for the scripts. Any way we can modify so it can be run in an album? Thanks.

batch title change in photo version 1

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