Copy link to clipboard
Copied
Hi All,
The below code I have found for Indesign to add meta data from the JSON, likewise I looking for photoshop psd files is it possible? Please share your thoughts.
var md = app.activeDocument.metadataPreferences;
var ns = "http://ns.adobe.com/xap/1.0/";
var p, v;
//the json object
var o = {"Name":"John Doe","id":"1234","Address":"Main Street"}
var props = o.reflect.properties;
for (var i = 0; i < props.length-4; i++){
p = props[i].name
v = o[props[i]]
md.setProperty(ns, p, v)
};
ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
var md = new XMPMeta(activeDocument.xmpMetadata.rawData)
var ns = "http://ns.adobe.com/xap/1.0/";
var p, v;
//the json object
var o = {"Name":"John Doe","id":"1234","Address":"Main Street"}
var props = o.reflect.properties;
for (var i = 0; i < props.length-4; i++){
p = props[i].name
v = o[props[i]]
md.setProperty(ns, p, v)
};
activeDocument.xmpMetadata.rawData = md.serialize()
Copy link to clipboard
Copied
ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
var md = new XMPMeta(activeDocument.xmpMetadata.rawData)
var ns = "http://ns.adobe.com/xap/1.0/";
var p, v;
//the json object
var o = {"Name":"John Doe","id":"1234","Address":"Main Street"}
var props = o.reflect.properties;
for (var i = 0; i < props.length-4; i++){
p = props[i].name
v = o[props[i]]
md.setProperty(ns, p, v)
};
activeDocument.xmpMetadata.rawData = md.serialize()