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

IMG Numbers in Photos

On a recent trip my camera lost the ability to record dates when photos were taken. (Since fixed.) So I have a whole bunch of photos with no dates, and Photos has this stupid system of storing photos in random order.

However every photo has an IMG number in the info pane. Is there any way that I can use these IMG numbers to get the pictures in sequence?

Thanks, Doug.

MacBook Pro

Posted on Jul 12, 2019 7:33 PM

Reply
Question marked as Best reply

Posted on Jul 13, 2019 10:13 AM

Photos cannot sort the photos by the filenames, but it can sort the photos by the titles. If you copy the filenames to the title field, you use this to sort your photos by the numbers you are seeing in the filenames.

You can run a script to copy the filenames to the title filed, see this script, for example:

Script: Batch Changing the Titles to the Filenames with Extension (Dec 19,2018)


Similar questions

12 replies
Question marked as Best reply

Jul 13, 2019 10:13 AM in response to bilda.ds

Photos cannot sort the photos by the filenames, but it can sort the photos by the titles. If you copy the filenames to the title field, you use this to sort your photos by the numbers you are seeing in the filenames.

You can run a script to copy the filenames to the title filed, see this script, for example:

Script: Batch Changing the Titles to the Filenames with Extension (Dec 19,2018)


Jul 15, 2019 2:29 AM in response to bilda.ds

The difference between Automator and Script Editor is, that Automator is a tool to combine actions into a workflow. It can include actions, that perform Apple Script code. I am not sure, why the Automator workflow is not working for you, since I cannot test this on my system.

Script Editor is an application to run Apple Scripts directly from the editor, the naked script without bells and whistles. It is easier to debug, because we can see the the error messages.

I am glad, you could get it to work.


To see the titles below the thumbnails open the "View" menu in Photos. Then click the menu item "Metadata" and enable "Titles".




Jul 14, 2019 5:47 AM in response to bilda.ds

I can no longer test in High Sierra, as my Mac is now running a newer system. How many photos have you selected, when you ran the script? It may have been timeout errors, when too many photos have been selected.

I'll try to add a different version of the script with more error checks.

Run it directly from the Script Editor.app. Paste the script into the editor, then select a few photos in Photos, then run press the "Run" button in Script Editor:


-- batch change the title of images to 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
			try
				tell im
					set its name to its filename
				end tell
			on error errText number errNum
				display dialog "Error: " & errNum & return & errText & "Trying again"
				try
					delay 2
					tell im
						set its name to its filename
					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"






Jul 14, 2019 10:49 PM in response to léonie

Hi Leonie,

I only selected a group of 4 photos to try and I tried a few times, so it shouldn't be a time out issue.

You now refer to a "Script Editor app." I don't seem to have this, previously we were working in Automator.

Is Script Editor something I need to download from somewhere?

Sorry, but I am out of my depth here!

Kind regards, Doug.

Jul 15, 2019 12:24 AM in response to bilda.ds

Hi again Leonie,

I found Script Editor in Utilities. I think I followed your instructions: pasted your script in to Script editor, selected 3 photos, pressed run. The selected photos did a little jump, and that's all...... tried a couple of times, same result.

Is Script Editor an alternative to Automator? Or was I supposed to be using both in some way?

Kind regards, Doug.

Jul 15, 2019 2:52 AM in response to léonie

Thanks very much Leonie,

I now have the 20 albums from our trip, all showing their IMG Number below the thumbnails.

I am most grateful for your help.

I have been able to answer my last question: "Sort by Title," and they are all in numerical order.

I might even get to like "Photos" now that I have some control.

Kind regards from New Zealand,

Doug.

IMG Numbers in Photos

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