Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


The "caption" field is read using getFormattedMetadata, but set with setRawMetadata?

Community Beginner ,
Jul 18, 2021 Jul 18, 2021

Copy link to clipboard

Copied

I need to read and write the "caption" metadata field. However, while it works, I don't trust the safety of an operation that involves...

local caption = photoSource:getFormattedMetadata('caption')
photoTarget:setRawMetadata('caption',caption)

... because the API docs clearly say:

Retrieves display-formatted metadata from this photo. Metadata is formatted as is shown in the metadata panel. The returned value strings are formatted for display; you should not attempt to parse them.

 

So, how can I go about getting a "raw" caption, not - possibly - mangled via "formatting", whatever that entails?

TOPICS
SDK

Views

29

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
community guidelines
LEGEND ,
Jul 18, 2021 Jul 18, 2021

Copy link to clipboard

Copied

For such fields, it is safe to read them getFormattedMetadata().  The documentation is misleading in this case.

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
community guidelines
Community Beginner ,
Jul 19, 2021 Jul 19, 2021

Copy link to clipboard

Copied

LATEST

That's what I went with, and it seems to be just fine - I managed to build a plugin copying a whole set of captions from one collection to another, copy-paste style 🙂 - but I wonder why on $Planet can some fields NOT be read via getRawMetadata, while they can be set with setRawMetadata?

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
community guidelines