app.project.xmpPacket
Description
The project’s XMP metadata, stored as RDF (XML-based). For more information on XMP, see the JavaScript Tools Guide.
Type
String; read/write.
Example
The following example code accessesthe XMPmetadata of the current project, and modifiestheLabel project metadata field.
var proj = app.project;
// load the XMP library as an ExtendScript ExternalObject
if (ExternalObject.AdobeXMPScript == undefined) {
ExternalObject.AdobeXMPScript = new
ExternalObject('lib:AdobeXMPScript');
}
var mdata = new XMPMeta(app.project.xmpPacket); // get the project’s XMP metadata
// update the Label project metadata’s value
var schemaNS = XMPMeta.getNamespaceURI(xmp");
var propName = "xmp:Label";
try {
mdata.setProperty(schemaNS, propName, "final version...no, really!");
}
catch(e) {
alert(e);
}
app.project.xmpPacket = mdata.serialize();