Is there someway to get a list of all missing photos from the photo library? I get the following error in Photos app on my Mac.

Missing File
Photos with unavailable original files cannot be opened.
The original photo “IMG_3076.JPG” is either offline or cannot be found. Click “Find Original” to reconnect.


I want to follow the instructions from how to avoid getting missing file error in photos, so my question now is, Is there some way to get all missing files from Photos library? It is going to be impossible to double click every photo to find out if it is missing. I need just the directories, i can place them back one by one and consolidate.
Short answer: you can use the script in this GitHub repo.

Long answer: 
I had the same question, and it turns out that the photo library is backed by a SQLite database under the covers. On your machine, you can find the database file at &lt;photo library root&gt;/database/photos.db. There's a table called RKMaster, with a row for every photo, and a fileIsReference column that tells you whether the photo is "external" or not.

The script I linked to simply dumps the list of all external files, and then iterates through to check that each one exists on disk.

Note that the table also includes an isMissing column, but this is not good enough by itself.  It only tells you about the files that Photos "knows" are missing, because you tried to double-click them, or use them in some way.  If you simply delete a file from disk, but don't try to access it in Photos, the isMissing column will be false.