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

Photos not showing up anymore in a specific smart album that should show all photos that are not in any album

Hello there.

I had a smart album. Configuration: "Album is not in any". This showed me all photos that are not in any album. Like this I am able to keep a good overview about which photos I have not sorted.

I created a new album and accidentally selected all photos that were in that smart album. This was not my intention so I pressed 'command + z' (reverting the creation of the album).

My expectation: The smart album should show all photos again like it was before the creation of the album. Because now - after the 'command + z' (deleting the album) - the photos are again in no album.


However, the photos are not in the Smart Album anymore. I can still see them when looking at all photos, however like this it is merely impossible for me to sort because I can't say which photos are not in an album already...


Anyone knows what I could do?


I already did a repair of the database from photos which did not help.


Best Regards,

Dave

MacBook Pro 16″, macOS 10.15

Posted on May 27, 2020 11:40 AM

Reply
Question marked as Best reply

Posted on May 28, 2020 3:41 AM

I modified my version of Jacques Rioux's script to search all albums and folders. It is working for my smal test library with 30 images, but I have not tested it on my main library with thousand albums and 50000 images.



The result for the small test library:

Similar questions

32 replies

May 27, 2020 11:22 PM in response to léonie

Wonderful, thank you very much for your fast reply.

Hey, Léoni, I took a script from you and adapted it. I am not really sure if it works since I am not used to Apple Script language.

I think the script could solve the problem instantly: My Goal with the script:

  1. Get all photos that are currently NOT in any album (I tried with another script => the photos not showing in the smart album are detected with a script)
  2. Put all these photos in an new album


=> When I have this, I can export all these photos from that album, delete the originals and re-import and the problem should be solved.

What do you think?


I attached the script I adapted from you - not sure if it works at the moment, but if you would have time, it would be nice if you could have a look at it and give me some feedback.


Best Regards,

Dave


May 28, 2020 2:17 AM in response to DanteToTheK

None of the older scripts that we published for finding the album a photo is in, is working right now with Photos 5 on catalina.

In particular this phrase:

set names to name of (albums whose id of media items contains pictureId)


We can no longer simply request Photos to return a list of all albums containing a certain picture or even a list of all albums, including the albums in folders. We have to write a recursive loop to collect all albums inside a folder, then recursively do the same for all subfolders. It is tedious and slow as molasses.

I tried to write a script to find all albums o photo is in, that would work on my Photos Library - it took hours to run: see

I gave up on scripting albums for the time being, after writing these two scripts: These scripts can give an idea, how to check all photos for the album they are in. It is messy.

May 27, 2020 10:46 PM in response to markwmsn

I can confirm that it is still buggy, even for new photo libraries.

  • As a test, I created a new library with just one photo
  • and created a top level album with the photo,
  • I created two smart albums, one with "Album is Any", one with "Album is not Any". The result looked good - "Album is Any" had one photo, "Album is not Any" was empty.


  • Now I deleted the Test Album. The smart albums did not update, even after restarting Photos . Really weird to be seeing "Album is Any" with one photo and "Album is not Any" emppty, if there is no album at all.
  • The old work-around is still working. If I duplicate the photo and delete the original, the smart albums are back to normal for the duplicates. Only the thumbnails of the albums do not update, but the numbers of photos are correct.

May 29, 2020 1:42 AM in response to léonie

Hey there. That is good to know - than something is definitely wrong here - at least for my computer :-)

I also have Catalina 10.15.5 && 1TB SSD.


I wouldn't know what is going on - it just seems to be stuck (the script). So I select all photos in the main photos library and then I run the script. I will try once more and if that does not succeed in the first 5-10 minutes, I will try the other solution from Léoni!


It is this script: Script: Find Photos not in Any Album, for… - Apple Community right?


Best Regards,

Dave

May 28, 2020 1:00 AM in response to DanteToTheK

First part of script:

set dialogResult to display dialog ¬
	"Enter the file size threshold for small photos or videos in kB : " buttons {"Cancel", "OK"} ¬
	default answer (defaultFileSizeThreshold as text)
set FileSizeThresholdkB to (text returned of dialogResult) as integer -- file size in kB
set FileSizeThreshold to FileSizeThresholdkB * 1024 -- file size in Byte




set photosNotInAnyAlbumName to "photosNotInAnyAlbum" -- the album to collect all photos not in any album


tell application "Photos"
	activate
	-- Ensure that the albums do exist
	try
		set imageSel to (get selection)
	on error errTexttwo number errNumtwo
		display dialog "Cannot get the selection: " & errNumtwo & return & errTexttwo
	end try
	--	return the size of the first item of imageSel
	
	try
		if not (exists container photosNotInAnyAlbumName) then
			make new album named photosNotInAnyAlbumName
		end if
		set theAlbumWithPhotosNotInAnyAlbum to container photosNotInAnyAlbumName
		
		if not (exists container "SkippedPhotos") then
			make new album named "SkippedPhotos"
		end if
		set theSkippedAlbum to container "SkippedPhotos"
		
		
	on error errTexttwo number errNumtwo
		display dialog "Cannot open albums: " & errNumtwo & return & errTexttwo
	end try
	
	
	-- process the selected photos from the All Photos album
	
	set photosNotInAnyAlbum to {} -- the list of small photos	
	
  • -- check, if the album o

Jun 4, 2020 1:31 AM in response to STCav

I have found what was causing the duplication process to fail. I'll explain it here in case it helps with anyone esle's problems


When selecting a collection of photos and trying to duplicate them, if the collection contains one photo that won't duplicate then none of them will. So selecting the whole album failed, but repeatedly selecting, say, the first 20 would work until a photo that won't duplicate gets into that group, in which case the first 20 won't duplicate. Reducing the size of the group gradually to one then identifies an individual photo that won't duplicate. Remove that photo and repeat.


Doing this for about 2,000 photos revealed about 14 that will not duplicate whatever I try. I kept 11 of these to review and I can't see much commonailty between them.

  • They're all in 2015, but that's the album I was working with. I haven't found a similar problem in any other year so far.
  • All but one are from the same camera, but that's mine so hardly surprising.
  • They have all been edited, but so have many others in the album.
  • There is a range of different types of views - scenes, interior, close up - so nothing seems peculiar to these.


So I have a few photos that were corrupting the 'duplicate then delete' process for fixing the 'in album' bug, but I have no idea what has corrupted those photos that causes them to be incapable of duplication.


Regards all,

Stephen

May 27, 2020 9:20 PM in response to DanteToTheK

Which dot release of Catalina are you running? Some of the users here have noticed a bug in Catalina that shows up similar to what you describe. If an album is deleted while it contains photos, those photos never get back into the "in no album" state (whether it's a count or a flag), breaking smart albums to detect unfixed photos. It is not unreasonable to think this bug could also be triggered by cmd-Z on album creation.


I do not know if anybody has tested the very newest Catalina 10.15.5 (with Photos Version 5.0 (151.19.150)) to see if it still has the bug.


I am unaware of any way to fix the photos affected by the bug other than restoring the whole library from a backup taken before the deletion of the non-empty album.

May 28, 2020 1:01 AM in response to DanteToTheK

Second part of the script: - Sorry was not possible in any other way... :-(

if imageSel is {} then
		error "Please select some images."
	else
		repeat with im in imageSel
			try
				tell im --get the file size
					set pictureId to its id
					set names to name of (albums whose id of media items contains pictureId)
				end tell
			on error errText number errNum
				display dialog "Error: " & errNum & return & errText & "Trying again"
				try
					delay 2
					tell im
						set pictureId to its id
						set names to name of (albums whose id of media items contains pictureId)
					end tell
				on error errTexttwo number errNumtwo
					display dialog "Skipping image due to repeated error: " & errNumtwo & return & errTexttwo
				end try
			end try
			set inNoAlbum to (names is missing value)
			if inNoAlbum then
				set photosNotInAnyAlbum to {im} & photosNotInAnyAlbum
			end if
		end repeat
		add photosNotInAnyAlbum to theAlbumWithPhotosNotInAnyAlbum
		return "Photos not in any album: " & (length of photosNotInAnyAlbum)
	end if
end tell

May 28, 2020 2:36 AM in response to léonie

Thank you very much for your response.

Hmm that is unfortunate, that such things are not available anymore.


So my script would be 'correct', but the specific line 'set names to name of (albums whose id of media items contains pictureId)' is not valid anymore?


And rewriting it quickly is not possible as much as I understand?


I mean I don't care if it takes 10 days until the process is finished --- in the end without a script I will have no chance to find out which photos are not in any album at the moment.


Or do you have any other suggestions?


Best Regards,

Dave



Ah and BTW: I tried out the script from Jacques Rioux's => It works for me, that it can tell me in which albums a photo is (given that I put it in a toplevel album).

That is why I don't understand, why my script shouldn't work?

I mean it is exactly the same syntax: set names to name of (albums whose id of media items contains pictureId) - or what am I missing?

May 28, 2020 11:23 AM in response to léonie

Hei there,

thank you very much. I am running the script - already since 6 hours - I don't know if this is working or not --- in my test photo library it worked for 5 photos.


Do you have any idea how long it could take for 10'000 photos and about 60 albums?


My albums folder is structured like the following (with folders and albums - but just 1 level deep)


Albums

2010 (folder)

album 1

album 2

2011 (folder)

album 1

etc.


thank you very much for your help!

Best Regards,

Dave

Photos not showing up anymore in a specific smart album that should show all photos that are not in any album

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