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?
Copy link to clipboard
Copied
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.