Photos not able to sort by title

Good Day, I am trying to sort my pictures in my album by title, it seems like not working.

When I try sort with 'newest' or 'oldest', both working fine.


May I know anyone have similar challenges and any suggested solution?


cheers!

MacBook Pro 13", macOS 10.15

Posted on Nov 1, 2019 3:17 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 3, 2019 4:54 AM

You would have to copy the filenames to the titles - either manually by copy and paste in the Info for a photo, or use an Automator action (or Apple Script)

On Photos 4.0 on Mojave this Automator workflow used to work:

Script: Batch Changing the Titles to the Filename - Apple Community

But currently (with Photos 5 on Catalina) it is broken. It cannot access the filenames of the selected images and is giving error messages. I am using the workaround of running the scripts on my my Mojave Macs and syncing the updated titles to the Catalina Mac with iCloud Photos.


My Apple Scripts are currently in Catalina only working, when I select the photos in the All Photos view, which is very inconvenient.


When I select the photos in All Photos, this Apple Script below is working: Open scriptEditor, paste the script into the editor window, select a few photos without a title, in the "All Photos" view, click the "run " button in Script Editor:

tell application "Photos"
	activate
	set imageSel to (get selection)
	set currentfilename to ""
	if imageSel is {} then
		error "Please select an image."
	else
		repeat with im in imageSel
			
			tell media item im
				set newtitle to the filename of im
				set oldtitle to the name of im
				if (exists (oldtitle)) then
					set newtitle to newtitle & " - " & oldtitle
				end if
				set the name of im to newtitle
			end tell
		end repeat
	end if
	return currentfilename
end tell

Similar questions

8 replies
Question marked as Top-ranking reply

Nov 3, 2019 4:54 AM in response to richard_mak

You would have to copy the filenames to the titles - either manually by copy and paste in the Info for a photo, or use an Automator action (or Apple Script)

On Photos 4.0 on Mojave this Automator workflow used to work:

Script: Batch Changing the Titles to the Filename - Apple Community

But currently (with Photos 5 on Catalina) it is broken. It cannot access the filenames of the selected images and is giving error messages. I am using the workaround of running the scripts on my my Mojave Macs and syncing the updated titles to the Catalina Mac with iCloud Photos.


My Apple Scripts are currently in Catalina only working, when I select the photos in the All Photos view, which is very inconvenient.


When I select the photos in All Photos, this Apple Script below is working: Open scriptEditor, paste the script into the editor window, select a few photos without a title, in the "All Photos" view, click the "run " button in Script Editor:

tell application "Photos"
	activate
	set imageSel to (get selection)
	set currentfilename to ""
	if imageSel is {} then
		error "Please select an image."
	else
		repeat with im in imageSel
			
			tell media item im
				set newtitle to the filename of im
				set oldtitle to the name of im
				if (exists (oldtitle)) then
					set newtitle to newtitle & " - " & oldtitle
				end if
				set the name of im to newtitle
			end tell
		end repeat
	end if
	return currentfilename
end tell

Nov 2, 2019 3:58 AM in response to richard_mak

Ya, I felt strange too, the albums are sorted well by the title, however, the pictures in these individual album not able to sort according to title.


I am not sure, Richard. Have you set each individual album to sort by title, or only the folder with the albums? Just, so we are on the same track when testing:

  • To sort the list of albums I am ctrl-clicking the folder with the albums in the sidebar and use "Sort > by Name".
  • To sort the photos in the albums I am ctrl-clicking the album and use "Sort > Keep sorted by Title"


There is a weird quirk. Photos is showing the filenames as a title, if a photo does not have a manually assigned title, but it will not sort the filenames like the custom titles.

If you have not copied the filenames to the title field, the photos with empty titles will be sorted in front of the photos with a custom title.

For example - the filenames are shown in gray, indicating, that the title is empty. All photos with empty titles are shown in front of the photos with a proper title. Only the proper titles, in white, are sorted.


I am usually copying the filename to the Title Field, if I want to sort the photos by the filename.


Nov 4, 2019 7:06 PM in response to léonie

Thanks Leonie, I manually change the title and it works fine now.

I normally change the title on my finder before I import, I think what I can do now is change it after I import. I didn't use the script since it seems not so convenience for now. I can select multiple pictures in my Photos, select 'info' icon and add on the title.

Many thanks and cheers!!

Nov 1, 2019 6:10 AM in response to richard_mak

That is strange, Richard.

I am using the same version, and the command "Sort > Keep Sorted by Title" is working well, for smart albums as well as for standard albums.

Do all photos have titles? Are there perhaps some titles starting with a space character or another invisible character? You may want to check the titles of the photos that are sorted incorrectly.

Have you already restarted the Mac and then tried to sort the album again?


I would also create a small test library with just a few photos and test, if you can sort the albums in a ew test library (Create additional libraries). If sorting is working in a test library, but not in your main library, try to repair the main library. (Repair the library)





This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Photos not able to sort by title

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