Skip to main content
johnrellis
Legend
nov. 30, 2023 5:47 AM UTC
Released

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

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. 

Ce sujet a été fermé aux réponses.

4 commentaires

johnrellis
Legend
mars 3, 2024 10:42 PM UTC

@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.

Traduire
Sunil_Bhaskaran
Inspiring
févr. 26, 2024 7:29 AM UTC

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

Traduire
johnrellis
Legend
févr. 25, 2024 6:01 AM UTC

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

Traduire
Rikk Flohr-Retired
Adobe Employee
févr. 21, 2024 5:05 AM UTC

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.

Traduire
Rikk Flohr: Adobe Photography Org