Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Edit IPTC Extension metadata in Photoshop script

Explorer ,
Dec 01, 2015 Dec 01, 2015

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.

TOPICS
Actions and scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Dec 02, 2015 Dec 02, 2015

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();

Translate
Adobe
Guide ,
Dec 02, 2015 Dec 02, 2015

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();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 06, 2015 Dec 06, 2015
LATEST

Thank you it works perfectly like a charm

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines