4 Replies Latest reply on Nov 9, 2014 7:37 PM by jcoller

    Exporting Adobe Illustrator XMP Data

    jcoller

      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

        • 1. Re: Exporting Adobe Illustrator XMP Data
          Ten A Adobe Community Professional

          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.

          • 2. Re: Exporting Adobe Illustrator XMP Data
            jcoller Level 1

            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

            • 3. Re: Exporting Adobe Illustrator XMP Data
              Ten A Adobe Community Professional

              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.

              • 4. Re: Exporting Adobe Illustrator XMP Data
                jcoller Level 1

                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