Apple Event: May 7th at 7 am PT

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

Catalina 10.15 Order of photos within Albums

I have about 20,000 photos/videos in Photos in hundreds of albums. Within each album I may have up to 350 photos which I have carefully ordered to tell a story (not by date). All was well, until I bought a new iMac with Catalina and imported my photos using Time Machine. All the albums and photos are in the new iMac, but about 10% of the photos within each album are in the wrong sequence. This new sequence makes no sense, photos are not arranged by filename or date or title, and anyway, view/sort is not selected. I still have my Time Machine backup. How can I rebuild the Catalina photo library without messing up the order within albums?


And ... if I do reload or spend hours re-sorting everything, how can I be sure it won't get messed up again?!




iMac 21.5", OS X 10.11

Posted on May 23, 2020 8:41 PM

Reply
Question marked as Best reply

Posted on May 24, 2020 10:19 AM

And ... if I do reload or spend hours re-sorting everything, how can I be sure it won't get messed up again?!

I don't know why the migration didn't keep the manual sorting in the albums but in the future you can batch rename the Title of the photos in each album with a common title (like Slide, or whatever you'd like) followed by a padded sequential number. That way you can sorte by title and keep the order you'd like.


You can use this AppleScript to do the batch renaming: Batch Change Title to Text w/Padded Sequential Numbers

The script compiled as an application can be downloaded from this tutorial site:  P01 - Applescripts from Photos’ User Tips Compiled as Applications

If you need to get the file name back to the title for one or more of the photos at a later date you can use this AppleScript: Script: Changing the Title to the Filename without Extension. You can also download this script compiled as an application from the same tutorial site at above.


Similar questions

5 replies
Question marked as Best reply

May 24, 2020 10:19 AM in response to AWfrustrated

And ... if I do reload or spend hours re-sorting everything, how can I be sure it won't get messed up again?!

I don't know why the migration didn't keep the manual sorting in the albums but in the future you can batch rename the Title of the photos in each album with a common title (like Slide, or whatever you'd like) followed by a padded sequential number. That way you can sorte by title and keep the order you'd like.


You can use this AppleScript to do the batch renaming: Batch Change Title to Text w/Padded Sequential Numbers

The script compiled as an application can be downloaded from this tutorial site:  P01 - Applescripts from Photos’ User Tips Compiled as Applications

If you need to get the file name back to the title for one or more of the photos at a later date you can use this AppleScript: Script: Changing the Title to the Filename without Extension. You can also download this script compiled as an application from the same tutorial site at above.


May 24, 2020 1:21 PM in response to AWfrustrated

I am using this script below to change the titles, so the title will be prefixed with the filename.

The script copies just the first ten characters of the filename before the existing title, so the title will not become too long. To run the script, copy and paste it into the script editor window.

Then select a few photos in Photos (in the All Photos View or a top level album) and click the Run button in Script Editor.

Test first with only a few photos, preferably in a different Photos Library for testing. Ans always make a curreent backup of your library before trying scripts - better safe than sorry.


-- batch append the title of images to the filename (only the first ten characters of the filename)
(* How to use this script:

Open this script in Script Editor. Launch Photos.

Select photos while viewing the  "All Photos" album; this works better than Moments or smart albums

When all all photo are selected press the "Run" button in Scripteditor. 
*)

set imageSel to {}

tell application "Photos"
	activate
	-- process the selected photos from the All Photos album
	try
		set imageSel to (get selection)
	on error errTexttwo number errNumtwo
		display dialog "Cannot get the selection: " & errNumtwo & return & errTexttwo
	end try
	
	--	check, if the album or the selected photos do contain images
	if imageSel is {} then
		error "Please select some images."
	else
		repeat with im in imageSel
			set oldTitle to (the name of im) --as string
			set oldTitleString to (the name of im) as string
			set hasTitle to (oldTitle is not equal to missing value) and (the length of oldTitleString > 0)
			if not hasTitle then
				set oldTitle to ""
			end if
			set newtitle to characters 1 thru 10 of (the filename of im as string) as string
			
			if hasTitle then
				set newtitle to newtitle & " - " & oldTitleString
			end if
			
			-- return newtitle
			try
				tell im
					set its name to newtitle
				end tell
			on error errText number errNum
				display dialog "Error: " & errNum & return & errText & "Trying again"
				try
					delay 2
					tell im
						set its name to newtitle
					end tell
				on error errTexttwo number errNumtwo
					display dialog "Skipping image due to repeated error: " & errNumtwo & return & errTexttwo
				end try
			end try
		end repeat
	end if
end tell
-- display dialog "Done"
return "Done"







May 25, 2020 2:20 AM in response to AWfrustrated

I have posted the script now as a new user tip, so we can find back to it:

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

Look there for any bug fixes or updates.

You may also want to look at this user tip: It contains some background information on ghe handling of filename and titles in Photos: Changes to "Sort by Title"; since Photos 5.0 on Catalina



To get started with Apple Script, you may want to look at the "Help" menu in Script Editor. There are links to the Apple Script User Guide and the Script Editor help.




May 24, 2020 1:08 PM in response to Old Toad

Thank you.


I have never programmed scripts on a Mac, but I believe either suggested script will override my existing titles. About a fifth of my photos have titles that I've typed in, so that would not be good for me. But I like the sequencing idea (inserting a sortable number as the first characters in each title). Any way a script could insert the sequential number in the title field while keeping the existing text?

Catalina 10.15 Order of photos within Albums

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