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

Function syntax for LrSelection:setRating

New Here ,
Dec 13, 2018 Dec 13, 2018

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?

TOPICS
SDK

Views

267

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

correct answers 1 Correct answer

New Here , Dec 13, 2018 Dec 13, 2018

Colon in LrSelection:setRating and :setColorLabel is wrong, syntax is LrSelection.setRating and LrSelection.setColorLabel.

Votes

Translate

Translate
New Here ,
Dec 13, 2018 Dec 13, 2018

Copy link to clipboard

Copied

Colon in LrSelection:setRating and :setColorLabel is wrong, syntax is LrSelection.setRating and LrSelection.setColorLabel.

Votes

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
New Here ,
Dec 13, 2018 Dec 13, 2018

Copy link to clipboard

Copied

LATEST

Thank you. That was it.

The functions without parameters seem to work either way.

Votes

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