Highlighted

Errors with photo:setPropertyForPlugin

Explorer ,
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

 

 

 

 

Most Valuable Participant
Correct answer by johnrellis | Most Valuable Participant

[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.]

 

TOPICS
SDK

Views

105

Likes

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

Errors with photo:setPropertyForPlugin

Explorer ,
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

 

 

 

 

Most Valuable Participant
Correct answer by johnrellis | Most Valuable Participant

[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.]

 

TOPICS
SDK

Views

106

Likes

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
Jun 27, 2020 0
Most Valuable Participant ,
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.]

 

Likes

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
Reply
Loading...
Jun 27, 2020 0
Most Valuable Participant ,
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.]

Likes

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
Reply
Loading...
Jun 27, 2020 0
Explorer ,
Jun 27, 2020

Copy link to clipboard

Copied

Do I need to declare the LRPlugin namespace as well? 

Likes

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
Reply
Loading...
Jun 27, 2020 0
Most Valuable Participant ,
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.]

Likes

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
Reply
Loading...
Jun 27, 2020 0
MomaZunk LATEST
Explorer ,
Jun 27, 2020

Copy link to clipboard

Copied

Awesome, that worked

Likes

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
Reply
Loading...
Jun 27, 2020 0