Skip to main content
Inspiring
Jan 27, 2025 5:28 PM UTC
Question

why might getActivePhoto( ) return an empty table

local photo = LrApplication.activeCatalog():getTargetPhoto() is returning an empty table, even though I have photos selected. I'm almost embarrased to ask, does anything spring to mind?
 

3 replies

johnrellis
Legend
Jan 27, 2025 5:55 PM UTC

I've never seen that before. The only thing that springs to mind is that preferences might be corrupted -- there have been a steady stream of infrequent reports over the years of selections working weirdly, corrected by resetting preferences and/or switching catalogs.

Translate
kimaldisAuthor
Inspiring
Jan 28, 2025 8:23 AM UTC

strangely, getActivePhotos() returns an array of selected photos correctly

 

also strangley, getActivePhoto is returning a zero length array when the documentation says it returns an LrPhoto.

 

Translate
kimaldisAuthor
Inspiring
Jan 28, 2025 8:58 AM UTC

Turns out it was a bug in my code mis-logging the photo object. Oops.

Translate