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

How To Set Custom Metadata Programmatically?

LEGEND ,
Jul 09, 2010 Jul 09, 2010

Copy link to clipboard

Copied

I could have sworn there was a way, but I sure can't figure it out right now - anybody know if or how?

PS - I thought at first catalog:setPropertyForPlugin would do it, but it seems to just set some invisible property, not the viewable, filterable, custom metadata kind.

Thanks,

Rob

TOPICS
SDK

Views

951

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
Community Expert ,
Jul 09, 2010 Jul 09, 2010

Copy link to clipboard

Copied

Have you referenced the field value correctly. That method should work, providing you reference the plug-in correctly, that the metadata definition is present, and you have a way of seeing the results (a panel, in filter panel or smart collections)

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 ,
Jul 09, 2010 Jul 09, 2010

Copy link to clipboard

Copied

To build on John's reply, double-check that the metadata definition declares the field browsable and searchable, e.g.

    metadataFieldsForPhotos = {
        {id = 'type',
         title = "Type",
         dataType = 'string',
         browsable = true,
         searchable = true},

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 ,
Jul 09, 2010 Jul 09, 2010

Copy link to clipboard

Copied

Oops, it was late - I was tired... - needs to be photo:setPropertyForPlugin, not catalog:setPropertyForPlugin. (Note: both those methods exist, they just do different things...)

Duh...

Thanks guyes,

Rob

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 ,
Jul 09, 2010 Jul 09, 2010

Copy link to clipboard

Copied

Yeah, there are many advantages to a dynamic language like Lua, but a big disadvantage is that pretty much any string of garbage

can be executed, which makes PUI (programming under the influence) dangerous 😞

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 ,
Jul 13, 2010 Jul 13, 2010

Copy link to clipboard

Copied

LATEST

photo:setPropertyForPlugin, not catalog:setPropertyForPlugin!

-R

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