Skip to main content
pedzsan
Inspiring
August 18, 2022
Answered

Move a keyword into or out from a parent using the SDK

  • August 18, 2022
  • 1 reply
  • 345 views

The title basically sums up what I want to do.  I have a long, ugly keyword list that I want to tidy up.  My thought is I would write code to do this rather than spend frustrating hours trying to do it with the GUI.

 

I see that I can create a keyword and at that time give it a parent (or not) and so in theory, I could find the old keyword, get the set of photos that have that keyword, create the new keyword, assign the new keyword to the photos, and then delete the old keyword.

 

I'm hoping there is an kinder gentler way of doing this.

 

This topic has been closed for replies.
Correct answer johnrellis

"I see that I can create a keyword and at that time give it a parent (or not) and so in theory, I could find the old keyword, get the set of photos that have that keyword, create the new keyword, assign the new keyword to the photos, and then delete the old keyword."

 

Can't do any better than that, unfortunately.    I submitted a feature request ten years ago for adding additional methods to LrKeyword that's been ignored:

https://community.adobe.com/t5/lightroom-classic-ideas/lightroom-sdk-small-enhancement-to-lrkeyword-to-relieve-pressure-from-users/idi-p/12249298

1 reply

johnrellis
johnrellisCorrect answer
Legend
August 18, 2022

"I see that I can create a keyword and at that time give it a parent (or not) and so in theory, I could find the old keyword, get the set of photos that have that keyword, create the new keyword, assign the new keyword to the photos, and then delete the old keyword."

 

Can't do any better than that, unfortunately.    I submitted a feature request ten years ago for adding additional methods to LrKeyword that's been ignored:

https://community.adobe.com/t5/lightroom-classic-ideas/lightroom-sdk-small-enhancement-to-lrkeyword-to-relieve-pressure-from-users/idi-p/12249298

pedzsan
pedzsanAuthor
Inspiring
August 19, 2022

For anyone following along, please note that my description above is incomplete.  The children (as well as the photos) of the original keyword would need to be "moved" (hence, created and their attributes, photos, and children copied) as well thus to do this correctly, it would need to be recursive.

 

Sigh!  time to start typing.

 

Oh, also, please correct me if I'm wrong but I can not find a delete keyword, destroy keyword, purge keywords, etc within the SDK so my tact is to do the "Purge Unused" via the GUI after the fact.  Again... sigh!!!!

 

It is almost as half baked as Lua itself: second possibly only to Pearl 5 for being strutural and OO schizophrenic and inadequate and incomplete in either personality.