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.

Where are photo file names?

I've "titled" many, many photos in iPhoto by changing the filename (e.g. "DSC_2254" --> "On vacation in Hawaii"), but there appears to be no option in Photos to show the filename. So none of my "titles" appear. Am I missing something?

iMac (Retina 5K, 27-inch, Late 2014), OS X Yosemite (10.10.3)

Posted on Apr 9, 2015 7:56 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 11, 2015 5:41 PM

That is an idea.


I experimented a bit, and with Apple Script we could make it a bit simpler, directly in Photos: This will save the installation of exiftool and the necessity to export the files. This way the lossless workflow will be preserved.


Create an Automator action, that executes an Apple Script to change the titles to the filename, if the title is empty:


The Apple Script:


on run {input, parameters}

tell application "Photos"

activate

set imageSel to (get selection)

if imageSel is {} then

error "Please select an image."

else

repeat with im in imageSel

set title to the name of im

if not (exists (title)) then

set the name of im to the filename of im

end if

end repeat

end if

end tell

return input

end run

Launch Automator, create a new service, and drag a "Run Apple Script" action into the workflow.

Copy and paste the text above into the "Run Apple Script" action to replace the default text in the action.

User uploaded file

Save this workflow with a suitable name. It will be installed in the services.


  • Now launch Photos and select a few test images.
  • Open the "Photos Menu > Services".
  • The service should be shown in the menu - I saved my version as "filename2title".
  • Select the service to let it run. When you click the selected photos again, the titles should change.


User uploaded file

After the Automator action completed:

User uploaded file



282 replies

Apr 14, 2015 2:05 PM in response to Old Toad

I got my wife's 2200 image library "titled" in about 5 minutes. I started with a few images, and keep increasing the number of images processed - and it did several hundred at a time without any problems - and pretty quickly too.


I ran into two issues:


(1) The first couple of times you try to run the service script, it fails with an error. Restarting the computer seemed to fix that.

(2) I have an administrator account and my wife has a normal user account on her iMac (I am trying to keep her safe). I originally created the Photo Service in my account - and it didn't show up in her account. I recreated it in her account, and it runs fine. I haven't seen anything that says how to create an service for all user account - which would be a handy option.


Thanks again for this very helpful fix.


David

Apr 14, 2015 2:29 PM in response to Old Toad

Old Toad wrote:

I just ran it on my 4700 photo library and it completed the task in about a minute or so. Was faster than I expected.

How fast is the Mac you used to do this? My 1/4 second per file estimate was a crude one, based on what I saw while using my iMac (a 2.9 GHz Intel Core i5 2012 model) to process batches of no more than 100 or so images at a time, with Photos in the foreground. I did notice there was a lag before the first title appeared, & after that they appeared more quickly in groups of around 8 or so images at a time.

Apr 14, 2015 3:09 PM in response to DRedfearn

DRedfearn wrote:

I haven't seen anything that says how to create an service for all user account - which would be a handy option.

Services created when you choose the Service document type in Automator are saved in the Services folder in the user's Library folder (~/Library/Services). There does not seem to be an equivalent folder in the root level Library folder so I'm guessing there is no straightforward way to create an 'all accounts' one. There probably would be permissions issues to work out as well.

Apr 14, 2015 6:27 PM in response to léonie

It looks like after running the script on the main copy of Photos, the titles don't show up on the other macs and iPhone and iPad being synchronized via iCloud. At least, it hasn't worked for me. (I ran the script for my main iMac - which synchronizes to another iMac, a MBA and to a iPhone 5s and an iPad Mini Retina. I have each of these devices set to conserve space.) Seems odd - Title is part of the metadata and should synchronize. The other metadata does show up.


David

Apr 15, 2015 2:12 AM in response to léonie

To add to the confusion, file names of photos does not seem to follow the file through synchronization between Macs using iCloud Photo Library, but are changed outside of users control. Maybe Apple will fix this in the next version, but currently I experience that if I have imported a file to Photos named e.g. "2014_summervacation_1" from a folder, when it syncronizes to the other mac, the file there may be called IMGXXXX.jpg. How consistant is that? So a workaround would maybe be to store the filename in the metadata as you are discussing here. Can anyone confirm that this file renaming is automatically happening?

Apr 15, 2015 8:48 AM in response to rbakke

I just noticed this morning, that the filename2title script has stopped working. I get no error message, but nothing happens. I tried opening Automator and stepping through the script, and it completes with no errors, but the (one) image I had selected doesn't get a title. The only thing that has changed is that Photos has completed uploading my complete library to iCloud. As I mentioned in an earlier post, the titles changed by the script don't make it back to the other devices linked to iCloud Photos. The rest of the metadata is intact, but the title is blank again. Ugh.


David

Apr 16, 2015 12:45 PM in response to Chris Lyons

My advice is to:


(1) Reboot your system and try again

and/or

(2) Open automator and try stepping through the script.


I got the same error the first couple of times I tried to run the script, but rebooting and stepping through the script seem to fix whatever problem was occurring.


The script is back working for me again after failing for a while.


I have pretty much decided to go back to Lightroom for all my photo organization and processing. I will only use Photos for my iPhone shots.


David

Apr 17, 2015 9:11 AM in response to DRedfearn

David;


Thanks. I rebooted but to no avail, so I logged in under my admin account and it works but only if run from Automator. Since this is my first attempt at scripting, maybe scripts only work from admin accounts. Also, the Service does not show up in Photos' menu system even though its visible in the \Library\Services folder. So I created a workflow app that works OK when run after selecting some photos. Fortunately Automator is reasonably self evident to use.


On a related topic, I tried deleting the newly created filename-as-title and tried the script again. Does not work. Its almost as if once a title is created and then deleted the script "sees" a title and won't overwrite it. Do you have any ideas as to a different script that would erase a previously created title ?


Thanks in advance .... Chris

Apr 17, 2015 9:31 AM in response to Chris Lyons

There is something very strange going with with how OS X handles the service scripts. It took me two or three tries to get the script working (rebooting, stepping through the script, etc.). Then it stopped working (after my library had been completely uploaded to iCloud Photos). Then it started working again. I am not a script expert, so I have no idea of what is going on here. And, I have noted that the titles don't show up on my linked devices (a second iMac and a MBA - along with an iPhone 5s and an iPad Mini Retina). You could go back to the original author (leonie - who is very helpful) and ask, but I suspect the script treats a "blank" Title (which you get when you manually delete the Title text) as present - as distinct from an "absent" title. If the script thinks the Title is present, it won't update. This is only a guess, however.


I have gotten the script to work both in my own (administrator) account, and my wife's standard user account. This is on the same iMac. I had to create the script twice - once under my account and then again under my wife's account. So, I know it doesn't require an administrative account. There doesn't seem to be any way to create the service and make it available to all users on the same Mac.


I hope Apple clears up some of these details, but the articles I have read so far (the TidBITS FAQ by Joe Kissell is very good) leave some things a mystery - basically, the reviewers have to experiment with the software - and as we have seen, you don't get consistent results.


I have decided that Photos is not for me. I am going to migrate all my "real" photo organization and editing to Lightroom. I have used LR for several years, but split my usage between iPhoto and LR. Now, I think Photos is only good for my iPhone photos, and that is what I am going to do. It will save me some money too, as I purchased the 500GB iCloud package because of the size of my libraries.


David

Apr 17, 2015 11:49 AM in response to DRedfearn

David;


Thanks so much for this dialog. You confirmed what I suspected and that is, lots of experimentation is required. I will take a look at LR as I've got ~20K or so photos and iPhoto did the job nicely for me. Photos also does not support geotagging, but other 3rd party apps do. I might just keeping using iPhoto while preparing to exit to LR.


Cheers ... Chris

May 3, 2015 7:29 AM in response to Community User

Hi,


I'd started with a script that included the extensions but then realised that I'd rather remove them. Possibly a little late in the day for you but this is my variation on the theme:


tell application "Photos"


activate

set updated to 0

set info to "Photos | Filename to Title"

set images to (get selection)

if images is {} then

display dialog "Please select items in Photos before calling this script." with titleinfobuttons {"OK"} giving up after 5

else

repeat with image in images

set title to the name of image

if not (exists (title)) or title = "" then

set revTitle to (reverse of (characters of the filename of image)) as string

set pos to offset of "." in revTitle

set prefix to (reverse of (characters (pos + 1) thru -1 of revTitle)) as string

set the name of image to prefix

set updated to updated + 1

else

set revTitle to (reverse of (characters of title)) as string

set pos to offset of "." in revTitle

set prefix to (reverse of (characters (pos + 1) thru -1 of revTitle)) as string

set postfix to (reverse of characters 1 thru (pos - 1) of revTitle) as string

if (offset of postfix in "jpg|mov|png") > 0 then -- Extend list as required

set the name of image to prefix

set updated to updated + 1

end if

end if

end repeat

if updated = 1 then

set message to " item was updated."

else

set message to " items were updated."

end if

if updated = 0 then

set message to "No" & message

else

setmessageto(updated as string) & message

end if


display dialogmessagewith titleinfobuttons {"OK"}

end if

end tell


This will add the filename without the extension as an image title, or remove any extension currently included in the title. I haven't caught up with all of the discussions but it seems that Photos can sometimes bomb out when running the script on large numbers of items, and it may be more reliable when running the script with the contents of an Album rather than the global photos collection.


tt2

Where are photo file names?

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