Changes to "Sort by Title" since Photos 5.0 on Catalina

by: 
Last modified: Jun 7, 2020 8:34 AM
3 1732 Last modified Jun 7, 2020 8:34 AM

This user tip has been reformatted and moved to

Sorting Albums by Title in Photos - Changes in Photos 5.0 on Catalina



----deprecated old version, ignore ------


Written for Photos 5.0 on macOS 10.15.2 and later


Three flavours of Titles in Photos


The sorting of albums by "Title" has changed in Photos 5.0 compared to Photos 4.0 on Catalina. The changes apply to the two flavours of titles. If we display the titles below the thumbnails in an album as described here (How to view the titles or filenames below the thumbnails - Apple Community), some "Titles" are displaying dimmed, and the the dimmed titles are just default titles and will be sorted differently from the real titles.

  • Custom Titles: The titles we assign to a photo by typing into the title field below the thumbnail or by by typing into the title field in the Info are real titles and shown with a high contrast. If a photo has a title assigned, it will appear in a smart album with the rule "Title is not empty".
  • Default Titles: If a photo has no title, the filename will be used as a default title. These default titles are shown as dimmed. We cannot copy and paste them. If we click into a dimmed default title field, the text will vanish. If a photo doses not have a title assigned, it will appear in a smart album with the rule "Title is empty".
  • Empty Titles: if we erase a title, the photo will still have a title, but the title is an empty string. Below the thumbnails we will be seeing the filename, but these photos will not appear in the smart album "Title is empty", but in the smart album "Title is not empty". Empty titles are to be avoided, if you want to export photos using the titles as filenames, see: Bug: Exporting Images with "Filename: Use Title" creates invisible files when the title has been erased - Apple Community


Sorting by Title in Photos 5.0:


When we sort an album by the titles, Photos 5.0 will ignore the photos without a custom title. The photos will be all appear at the start of the sorted album, showing the filenames instead of a title, but these photos will not be sorted by the filename. This has been different in Photos 4.0. Photos 4.0 uses the filenames to sort the photos by the title, if they do not have a custom title. The photos with real titles will be sorted alphabetically, as expected.


Here is an example:


The two first photos in this album do not have a custom title assigned. The filenames are shown instead of the title, dimmed. These two photos are not sorted alphabetically. All other photos are sorted alphabetically, as expected. Some photos with ethnic characters are appearing at the end of the album, for example the Icelandic "Þ"


A work-Around with Apple Script: Prefix the Titles by the Filename


To be able to sort again by the filenames in Catalina, we have to copy the filenames to the titles.

I am using occasionally the filename as a prefix to the title and copy the filename to the title using an Apple Script or Automator service or Quick Action (https://discussions.apple.com/docs/DOC-250000346). In Catalina we have currently to select the photos in All Photos or a top level album to be able pass them to an Apple Script. When I select the photos in All Photos, this Apple Script below is working:

  • Open Script Editor, 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:


This script will not replace existing titles, but adds the filename as a prefix to the title. This is nice, if the filenames are short image numbers.

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


If you only want a part of the filename as the prefix (the part with the image number), see this script:

Script: Batch Change the Title of a Photo to the Filename Followed by the Existing Title

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