ExtendScript: copy all Project metadata from a ProjectItem to another?

Explorer ,
Mar 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied

I'm trying to copy all metadata (both Project metadata and XMP metadata) from a ProjectItem to another. 

 

With the XMP metadata the task is pretty simple:

var source = app.project.rootItem.children[/*sourceIndex*/];
var target = app.project.rootItem.children[/*targetIndex*/];

target.setXMPMetadata(source.getXMPMetadata());

When it comes to the Project metadata, the setProjectMetadata() method wants the serialized metadata and an array containing the names of the fields to be updated. Why is the API different here? Can't I just simply copy all the fields in the Project metadata as with the XMP one?

TOPICS
Editing , SDK

Views

44

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

correct answers 1 Correct answer

Adobe Employee , Mar 03, 2022 Mar 03, 2022
Why they are different: Because they contain different sets of (meta)data, have different lifetimes, and are used for different purposes.  > Can't I just simply copy all the fields in the Project metadata as with the XMP one? No, as the sample code demonstrates.

Likes

Translate

Translate
Adobe Employee ,
Mar 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied

LATEST

Why they are different: Because they contain different sets of (meta)data, have different lifetimes, and are used for different purposes. 

Can't I just simply copy all the fields in the Project metadata as with the XMP one?

No, as the sample code demonstrates.

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