Copy link to clipboard
Copied
Hello
I have a Lua syntax question.
I'm trying to set a color label and a star rating to selected images in Lightroom.
LrSelection:increaseRating() works just fine.
LrSelection:setRating(3) throws an error about doing arithmetic on a table value.
LrSelection:setColorLabel("green") throws the error "Label must be one of none, red, green, yellow, blue, purple"
I tried all the syntax variations I could come up with, with no success.
local param = {}
param.label = "green"
LrSelection:setColorLabel(param)
LrSelection:setRating{rating=3}
How are you supposed to call these functions?
Colon in LrSelection:setRating and :setColorLabel is wrong, syntax is LrSelection.setRating and LrSelection.setColorLabel.
Copy link to clipboard
Copied
Colon in LrSelection:setRating and :setColorLabel is wrong, syntax is LrSelection.setRating and LrSelection.setColorLabel.
Copy link to clipboard
Copied
Thank you. That was it.
The functions without parameters seem to work either way.