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

Displaying data from other metadata in your custom metadata.

Participant ,
Jul 13, 2020 Jul 13, 2020

Copy link to clipboard

Copied

Hello everyone
Now you need to display your own field with a drop-down list of system metadata in the metadata field.
That is, there is a table "licensor" in it there are several values. The goal is to display these values in the list and make it possible to select one of them using the "enum"field.

 

 

local f = {}
function f.test( oneLrPhoto )
	local temp = oneLrPhoto:getFormattedMetadata("licensor") or ""
	local data = temp[1].LicensorName
	return data
end

 

 

I enabled it in the file where the list of my tags is generated  

 

 

local LrApplication = import("LrApplication")
local catalog = LrApplication.activeCatalog()
local selectedPhoto = catalog.targetPhoto
require 'coreFunction'
local test = f.test(selectedPhoto)

 

 

and formed a new tag

 

 

photoMetadata[#photoMetadata + 1] =
{ id='cm_test', 			version=0, title = LOC "$$$/CustomMetadata/Fields/CM=ТЕСТ ", dataType='enum', searchable=true, browsable=true,
	values = {
		{ value=nil,	      title = tostring(test), },
	} }

 

 

in .lrtemplate registered a new tag

As a result, it doesn't work. The only thing I was able to achieve was to output local Identifier in the same way via the following function

 

 

local f = {}
function f.Identifier( oneLrPhoto )
	local id = oneLrPhoto.localIdentifier
	return id
end

 

 

But also with the 'enum' type. ID shows without problems, but only one for all photos. (For the selected LR when loading)
As I understand it there is no way to output data in one tag from another?

TOPICS
SDK , Windows

Views

160

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
Advocate ,
Jul 13, 2020 Jul 13, 2020

Copy link to clipboard

Copied

Have you seen this from John Rellis?

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
Participant ,
Jul 13, 2020 Jul 13, 2020

Copy link to clipboard

Copied

LATEST

Yes, thank you!

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