Highlighted

Displaying data from other metadata in your custom metadata.

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

How to, SDK, Windows

Views

42

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

Displaying data from other metadata in your custom metadata.

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

How to, SDK, Windows

Views

43

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
Adobe Community Professional ,
Jul 13, 2020

Copy link to clipboard

Copied

Have you seen this from John Rellis?

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

Copy link to clipboard

Copied

Yes, thank you!

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