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

Exporting Adobe Illustrator XMP Data

Guest
Nov 07, 2014 Nov 07, 2014

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

1.9K

Translate

Translate

Report

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
Adobe
Community Expert ,
Nov 09, 2014 Nov 09, 2014

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
Guest
Nov 09, 2014 Nov 09, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Community Expert ,
Nov 09, 2014 Nov 09, 2014

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
Guest
Nov 09, 2014 Nov 09, 2014

Copy link to clipboard

Copied

Yes, I already have a saved document and the job is coming in for revision. My user will trigger this script after there're done with the .ai file and while they still have the .ai file open on screen.

Exporting xml data is actually part of my "file saving/exporting workflow", I already have first part of the workflow sorted (.ai file > export PDF > export xmp) and now I need to build the exporting xmp part.

Regards,

Jeno

Votes

Translate

Translate

Report

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
Contributor ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

LATEST

Hi Ten,

 

I just found this old thread. Do you know whether it is safe to store xmp within a "documentAfterSave" handler, when the document remains open and may be saved again

Votes

Translate

Translate

Report

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