Skip to main content
Participant
July 17, 2025
Answered

How to Retrieve the "Edited" Status via the SDK

  • July 17, 2025
  • 4 replies
  • 292 views

Hello,
I’m a student based in Japan, currently building a Lightroom Classic plugin using SDK version 14.0.
Please note that this post has been translated using a translation tool—my apologies if any parts sound unnatural.

In my plugin, I want to process only the images in the catalog that have been edited. However, I’m not sure how to retrieve the "edited" status (or flag?) through the SDK.

As a temporary workaround, I’ve been using the editCount value obtained via getRawMetadata. But this includes images that have only had metadata changes, such as rating or comments, which I would like to exclude.

Is there any way to access the same "Edited" status as seen in Smart Collections or the Library Filter via the SDK? Or alternatively, is there a way to replicate that functionality programmatically?

I’d appreciate any ideas or guidance. Thank you!

Correct answer johnrellis

The only way to get the edited status is to use catalog:findPhotos() using the criteria "edit" (for Has Edits) or "hasAdjustments" (for Has Adjustments) and then test whether the photo is in the set of returned photos. It should be fast enough for most purposes.

4 replies

Participant
July 18, 2025

@johnrellis @C.Cella
Using the findPhotos method, I was able to successfully filter by the edited status!
Thank you so much for pulling me out of the maze.

To be honest, just before receiving your replies, I was considering using Smart Collections for this.
However, since Smart Collections can't be applied to a new catalog with a single click (they have to be created manually), I saw that as a limitation.

I’m truly grateful to both of you for your guidance!

C.Cella
Legend
July 18, 2025

@suzukuretsuki_3442 

You can import Smart Collections in a new catalog after you exported them.

 catalog:findPhotos() is one of the most useful API in the SDK.

It will surely come in handy in the future for your codes.

 

I actually should have started to use it sooner 😬

 

.

C.Cella
Legend
July 18, 2025

@suzukuretsuki_3442 

@johnrellis said it all but if I my add something the SDK Manual also provides a quite clever method to figure out any search criteria that is available to Smart Collections

1. Create a Smart Collection in Lightroom Classic with the criteria of your choice.

2. Right click the resulting smart collection in the panel and choose “Export Smart Collection

Settings.” ...export to a location of your choice

3. Open the resulting .lrsmcol file in a text editor.

Many search criteria are not documented at all but are available to the SDK and this is a way to figure them out...or ask John 😉

 

.

Participant
July 17, 2025

Hello,
I’m a student based in Japan, currently building a Lightroom Classic plugin using SDK version 14.0.
Please note that this post has been translated using a translation tool—my apologies if any parts sound unnatural.

In my plugin, I want to process only the images in the catalog that have been edited. However, I’m not sure how to retrieve the "edited" status (or flag?) through the SDK.

As a temporary workaround, I’ve been using the editCount value obtained via getRawMetadata. But this includes images that have only had metadata changes, such as rating or comments, which I would like to exclude.

Is there any way to access the same "Edited" status as seen in Smart Collections or the Library Filter via the SDK? Or alternatively, is there a way to replicate that functionality programmatically?

  1. I’d appreciate any ideas or guidance. Thank you!
johnrellis
johnrellisCorrect answer
Legend
July 18, 2025

The only way to get the edited status is to use catalog:findPhotos() using the criteria "edit" (for Has Edits) or "hasAdjustments" (for Has Adjustments) and then test whether the photo is in the set of returned photos. It should be fast enough for most purposes.