Write metadata "instructions"
Hi
I´m trying to edit the metadata "instructions" in some photos vieweb by Bridge. At true, I need to preserve what´s already written in this field, then add some more things via script.
Here´s my try:
var doc = app.document;
doc.selectAll();
var sel = doc.getSelection ("psd, ai, tif, tiff, jpg, png, bmp, jpeg");
if (ExternalObject.AdobeXMPScript==undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
for (var g=0 ; g<sel.length ; g++){
var xFile = new XMPFile (sel
var xmp = xFile.getXMP();
var x = sel
var instruc = new String (x.read ("http://ns.adobe.com/photoshop/1.0/", "Instructions"));
instruc = instruc + "<test bonus instruction>";
//up to this line, everything is right
xmp.deleteProperty (XMPConst.NS_XML, "instructions") //problem is this line and/or the line below. It does not return error, but do not write too.
xmp.appendArrayItem(XMPConst.NS_XML, "instructions", instruc, 0, XMPConst.ARRAY_IS_ORDERED); //problem can be here.
};
if (xFile.canPutXMP(xmp)){
xFile.putXMP(xmp);
xFile.closeFile(XMPConst.CLOSE_UPDATE_SAFETY);
};
What Am I missing?
Thank you a lot for the help
Best Regards
Gustavo.
