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

Errors with photo:setPropertyForPlugin

Explorer ,
Jun 27, 2020 Jun 27, 2020

Copy link to clipboard

Copied

I am trying to write to a custom metadata field. 

 

I am using photo:setPropertyForPlugin, and I cannot seem to get the action to work. 

plugin id - geeky.snapshot
plugin field - gRecentPubDate

var - local variable with value

 

When I use the following

   photo:setPropertyForPlugin("geeky.snapshot", "gRecentPubDate" , var)

I get the error that the first paramenter must be the _pluginID object

 

When I use the following: 
    photo:setPropertyForPlugin(geeky.snapshot, gRecentPubDate , var)

I get the error that attempt to index global "geeky" (a nil value)

 

Do I need to declare the pluginID somewhere other than the info.lua file? 

 

TIA

 

 

 

 

TOPICS
SDK

Views

279

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

LEGEND , Jun 27, 2020 Jun 27, 2020

[This post contains embedded images that don't appear in email. View the post in your Web browser to see the images.]

 

The API reference says the first object must be of type _PLUGIN:

johnrellis_0-1593280600674.png

 

That's a slight typo -- it should read "LrPlugin". The API reference for LrPlugin indicates there's just one way to get a LrPlugin object, using the global variable _PLUGIN:

johnrellis_1-1593280502217.png

So use _PLUGIN as the first argument.

 

[Use the blue reply button under the first post to ensure replies sort properly.]

 

Votes

Translate

Translate
LEGEND ,
Jun 27, 2020 Jun 27, 2020

Copy link to clipboard

Copied

[This post contains embedded images that don't appear in email. View the post in your Web browser to see the images.]

 

The API reference says the first object must be of type _PLUGIN:

johnrellis_0-1593280600674.png

 

That's a slight typo -- it should read "LrPlugin". The API reference for LrPlugin indicates there's just one way to get a LrPlugin object, using the global variable _PLUGIN:

johnrellis_1-1593280502217.png

So use _PLUGIN as the first argument.

 

[Use the blue reply button under the first post to ensure replies sort properly.]

 

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
LEGEND ,
Jun 27, 2020 Jun 27, 2020

Copy link to clipboard

Copied

I just updated my reply to include the correct second screenshot. Look at the reply in your Web browser, not your email reader.

 

[Use the blue reply button under the first post to ensure replies sort properly.]

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
Explorer ,
Jun 27, 2020 Jun 27, 2020

Copy link to clipboard

Copied

Do I need to declare the LRPlugin namespace as well? 

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
LEGEND ,
Jun 27, 2020 Jun 27, 2020

Copy link to clipboard

Copied

No, just reference _PLUGIN.

 

[Use the blue reply button under the first post to ensure replies sort properly.]

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
Explorer ,
Jun 27, 2020 Jun 27, 2020

Copy link to clipboard

Copied

LATEST

Awesome, that worked

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