Is there some way to automatically find and remove all the "broken referenced" in Apple's Photo App?

I like apple's Photo app but I am not willing to let it manage my photos library for many reasons (eg I want to manage and edit the same files from different applications such as Bridge but I also want to access my photo library on other windows machines on the network etc). So I'm looking into using the Photos app with referenced files, not consolidated ones. For the most part it's working fine; But when I delete files via the Finder, I have no way of gathering up and de-referencing these broken references.

If for instance I delete a 1000 photos, I have to manually go through each of the 100,000 photos in my Photos library to see which references ones are broken.

Is there some way to detect which ones no longer exist? I don't mind getting my hands dirty with SQL, scripting, or the terminal - so any guidance is helpful!


Buy PhotoSweeper. It can search photos in the library with many conditions, including referenced or missing:

enter image description here

enter image description here

After you remove these photos, they are added to the album named “Trash (PhotoSweeper)”.

enter image description here

ref: https://discussions.apple.com/thread/7993327