• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
22

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

LEGEND ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

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=wnvyv921u...

 

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. 

Bug Fixed
TOPICS
macOS , SDK , Windows

Views

495

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
4 Comments
Adobe Employee ,
Feb 20, 2024 Feb 20, 2024

Copy link to clipboard

Copied

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 - Customer Advocacy: Adobe Photography Products
Status Fixed

Votes

Translate

Translate

Report

Report
LEGEND ,
Feb 24, 2024 Feb 24, 2024

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Feb 25, 2024 Feb 25, 2024

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
LEGEND ,
Mar 03, 2024 Mar 03, 2024

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report