Skip to main content
Inspiring
May 14, 2015
Answered

Set pick/rejected flag in catalog?

  • May 14, 2015
  • 2 replies
  • 633 views

Hi there,

I'm looking for a way to set the pick/rejected flags of photos.

I know: - LR does it not by metatags but in the catalog.

            - This has already been discussed in this forum in 2011 without positive result.

Have there been any changes since 2011? Maybe in LR 6?

Is there any other way to "mark" photos temporarily without writing metadata?

Or is there a function collection:addPhoto() for smartcollection in LR 6 (in LR 5 it is not allowed as far as I understand).

Thanks for your help.

Wolfgang

This topic has been closed for replies.
Correct answer johnrellis

The LR 6 APIs include LrSelection, which functions for getting the current flag and changing the flag: Lightroom 6 SDK Changes.  There's no documentation yet, but it appears the functions operate on the currently selected photos.  So if you want to change the flags on other photos, you'd probably have to save the current selection, change it to the photo you want to change, make the flag change, then restore the selection.

2 replies

WDBerlinAuthor
Inspiring
May 15, 2015

Thanks! This code does exactly, what I wanted:

     local mostSelected = listMark[#listMark]    --the last one

    table.remove(listMark, #listMark)

   

    local mySelection = import "LrSelection"

    mySelection:selectAll()

    mySelection:removeFlag()

   

    myCatalog:setSelectedPhotos(mostSelected, listMark)

   

    mySelection:flagAsPick()

    mySelection:selectNone()

Kind regards,

Wolfgang

johnrellis
johnrellisCorrect answer
Legend
May 15, 2015

The LR 6 APIs include LrSelection, which functions for getting the current flag and changing the flag: Lightroom 6 SDK Changes.  There's no documentation yet, but it appears the functions operate on the currently selected photos.  So if you want to change the flags on other photos, you'd probably have to save the current selection, change it to the photo you want to change, make the flag change, then restore the selection.