Copy link to clipboard
Copied
Hi,
I'm using a droplet which based on a script will rename my pictures.
I would like to save the original file name in the Supplier's Image ID metadata if possible.
Can I do that only in Photoshop without using Bridge?
I've tried to do a couple of things but I'm always failing.
For now I was using this:
function saveJpeg(docRef, targetFolder){
var theName = getNameWithoutExt(docRef);
var doc = activeDocument;
doc.info.caption += ">>>> ORIGINAL NAME: ";
doc.info.caption += doc.name;
var desiredName = truncate(theName.replace(/[^\w\s\d\(\)~_~-]/gi, ''),50);
var thePath = app.activeDocument.path;
var theFile = new File (targetFolder + "/" + desiredName + ".jpg");
BLA BLA BLA
Thanks for your help, still digging in the meanwhile.
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
xmp = new XMPMeta( app.activeDocument.xmpMetadata.rawData );
xmp.setProperty("http://ns.useplus.org/ldf/xmp/1.0/","ImageSupplierImageID", activeDocument.name);
app.activeDocument.xmpMetadata.rawData = xmp.serialize();
Copy link to clipboard
Copied
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
xmp = new XMPMeta( app.activeDocument.xmpMetadata.rawData );
xmp.setProperty("http://ns.useplus.org/ldf/xmp/1.0/","ImageSupplierImageID", activeDocument.name);
app.activeDocument.xmpMetadata.rawData = xmp.serialize();
Copy link to clipboard
Copied
Thank you it works perfectly like a charm
Find more inspiration, events, and resources on the new Adobe Community
Explore Now