Skip to main content
November 7, 2014
Question

Exporting Adobe Illustrator XMP Data

  • November 7, 2014
  • 1 reply
  • 2127 views

Hello,

My biggest problem is that doesn't know how to write script. Can anyone kind enough to enlighten me with a ExtendScript to export Adobe illustrator XMP data into a xml file please?


Regards,

Jeno

This topic has been closed for replies.

1 reply

Ten A
Community Expert
Community Expert
November 10, 2014

Using ExternalObject is one of easer way to access XMP Metadata.

I think below sample code help you to get XMP Metadata:

// load the library

if (ExternalObject.AdobeXMPScript == undefined) {

  ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');

  }

var fNm = File.openDialog ("select target file");

var xmp = new XMPFile( fNm.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ);

obj = xmp.getXMP();

xmp.closeFile();

alert(obj.serialize(XMPConst.SERIALIZE_READ_ONLY_PACKET | XMPConst.SERIALIZE_USE_COMPACT_FORMAT));

This script alert selected files XMP Strings.

"JavaScript Tools Guide CC.pdf" file also helps you understanding manipurating XMP Metada.

Ten.

November 10, 2014

Thanks Ten,

Now if I already have a .ai file opened. How do I export all the xmp data into a external xml file (where the .ai file is located)?

Regards,

Jeno

Ten A
Community Expert
Community Expert
November 10, 2014

You need to save current document and get it's meta data.

Probably, If you get non saved documents information from file->file information, Its template files metadata, not current editing documents info.

Ten.