Skip to main content
johnrellis
Genius
November 30, 2023

P: SDK: keyword:setAttributes() fails to change the case of the keyword's name

  • November 30, 2023
  • 4 replies
  • 1358 views

keyword:setAttributes() can't change the case of a keyword's name, e.g. from "a" to "A", even though the user can do that in the UI.


To reproduce in LR 13.0.1 / Mac OS 14.1:

 

1. Download this tiny catalog: 

https://www.dropbox.com/scl/fi/r17o9uf94v3plsr4i5yxs/keyword-name-bug.2023.11.29.zip?rlkey=wnvyv921uso57zqsq75w83eds&dl=0

 

2. Copy the script "keyword-name-bug.lua" from the catalog folder to the Scripts subfolder in the Lightroom settings folder.

 

3. Open the catalog in LR. Observe it has one keyword named "a".

 

4. Do Scripts > keyword-name-bug, which should rename that keyword to "A" and display "true". But observe the rename fails and it returns "false" (incorrect).

 

5. In the Keyword List panel, right-click the keyword, do Edit Keyword Tag, and change its name to "A", demonstrating that users can change the case of keywords.

 

6. In the Keyword List panel, rename the keyword to "x".

 

7. Do Scripts > keyword-name-bug, and observe the keyword gets renamed to "A", demonstrating that the script works correctly otherwise. 

This topic has been closed for replies.

4 replies

johnrellis
Genius
March 3, 2024

@Sunil_Bhaskaran, sorry for the delay in replying, I've been travelling. The new "ignoreCase" parameter works well, thanks. I'll modify my Any Tag plugin's Import Keywords command (which allows batch-editing of existing keywords) to use it.

Sunil_Bhaskaran
Community Manager
Community Manager
February 26, 2024

We have added a new parameter ignoreCase to solve this issue.
Here is the updated version of the script. Could you please verify if it works? The documentation needs to be updated.


import "LrTasks".startAsyncTask (function ()
local catalog = import "LrApplication".activeCatalog ()
local keyword = catalog:getKeywords ()[1]
local success
catalog:withWriteAccessDo ("Test", function ()
success = keyword:setAttributes {
keywordName = "A",
ignoreCase = true
}
end)
import "LrDialogs".message (tostring (success))
end)

 Thanks,
Sunil

johnrellis
Genius
February 25, 2024

@Rikk Flohr: Photography, the bug recipe above still fails in LR 13.2 😞

Rikk Flohr_Photography
Community Manager
Community Manager
February 21, 2024

Greetings all,

 

Updates for the Adobe Photography Products have been released.  The February 2024 updates contain an update for this issue. 

If you do not see the update in your Creative Cloud Application, you can refresh it by hitting [Ctrl/Cmd]+[Alt/Opt]+[ R ].

Note: It may take up to 24 hours for your update to be available in your Creative Cloud app.

 

Thank you for being so patient.

Rikk Flohr: Adobe Photography Org