Accessing OriginalRawFileName through xmp?
Hi!
I am having trouble with accessing the XMP OriginalRawFileName - can anyone help me?
I need to be able to read what the original filename of a picture is, and figured this would be easiest to solve by looking at the xmp data, but I can't even read that properly - I am obviously doing something wrong.
SuperMerlin wrote this, and I tried just copy/pasting it - but I cannot get a result even from the unmodified original code;
#target photoshop;
if(documents.length){
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
var xmp = new XMPMeta(activeDocument.xmpMetadata.rawData);
var shadow = xmp.getProperty(XMPConst.NS_CAMERA_RAW,"ParametricShadowSplit");
var exposureValue = xmp.getProperty(XMPConst.NS_CAMERA_RAW, "Exposure");
var keys = getArrayItems(XMPConst.NS_DC,'subject');
for(var a in keys){
//amend the match for your keywod
if(keys.toString().match(/key1/)){
//things to do if keyword found
alert("keyword found");
break;
}
}
};
function getArrayItems(ns, prop){
var arrItem=[];
var items = xmp.countArrayItems(ns, prop);
for(var i = 1;i <= items;i++){
arrItem.push(xmp.getArrayItem(ns, prop, i));
}
return arrItem;
};
So - how would one modify the above (or write new code) to access the OriginalRawFileName?
Thank you in advance!