Skip to main content
Participant
August 17, 2022
Question

Extract data from AI file

  • August 17, 2022
  • 0 replies
  • 1090 views

Hi all,

 

With a very limited understanding of Javascript / Applescript I've managed to hack a number of scripts together to perform the functions I need within Illustrator. But what I'm trying to do now has me completely stumped.

 

I'm looking for a way to extract some data from an AI / PDF file and either copy it to the clipboard or save it to a basic text file in a list format.

 

I can see the data I need when I open the document in a text editor. Items in bold are what I'm looking to extract. I only posted the sections containing the relevant data but can include the entire file if necessary.

 

         <xmpMM:Manifest>

            <rdf:Seq>

               <rdf:li rdf:parseType="Resource">

                  <stMfs:linkForm>EmbedByReference</stMfs:linkForm>

                  <stMfs:reference rdf:parseType="Resource">

                     <stRef:filePath>/Users/Username/Documents/Working Files/Customers/Z03668-R1/Z03668-R1 CAN CK PRO Vanilla Pancake (200612_1200).pdf</stRef:filePath>

                     <stRef:documentID>xmp.did:bd0834c1-20d8-4279-a27a-2435a16e3384</stRef:documentID>

                     <stRef:instanceID>uuid:fa7b3b48-334a-c846-bdd3-baac1be64ffc</stRef:instanceID>

                  </stMfs:reference>

               </rdf:li>

               <rdf:li rdf:parseType="Resource">

                  <stMfs:linkForm>EmbedByReference</stMfs:linkForm>

                  <stMfs:reference rdf:parseType="Resource">

                     <stRef:filePath>/Users/Username/Documents/Working Files/Customers/Z03668-R1/Z03668-R1 CAN CK Banana Pancake (200612_1159).pdf</stRef:filePath>

                     <stRef:documentID>xmp.did:a0e3c061-59d4-4f5b-8fb7-e4ee9497f8c5</stRef:documentID>

                     <stRef:instanceID>uuid:fdf8230d-fe94-314e-a0b4-de1f57984e60</stRef:instanceID>

                  </stMfs:reference>

               </rdf:li>

               <rdf:li rdf:parseType="Resource">

                  <stMfs:linkForm>EmbedByReference</stMfs:linkForm>

                  <stMfs:reference rdf:parseType="Resource">

                     <stRef:filePath>/Users/Username/Documents/Working Files/Customers/Z03668-R1/Z03668-R1 CAN CK Banana Pancake (200612_1159).pdf</stRef:filePath>

                     <stRef:documentID>xmp.did:a0e3c061-59d4-4f5b-8fb7-e4ee9497f8c5</stRef:documentID>

                     <stRef:instanceID>uuid:fdf8230d-fe94-314e-a0b4-de1f57984e60</stRef:instanceID>

                  </stMfs:reference>

               </rdf:li>

               <rdf:li rdf:parseType="Resource">

                  <stMfs:linkForm>EmbedByReference</stMfs:linkForm>

                  <stMfs:reference rdf:parseType="Resource">

                     <stRef:filePath>/Users/Username/Documents/Working Files/Customers/Z03668-R1/Z03668-R1 CAN CK PRO Vanilla Pancake (200612_1200).pdf</stRef:filePath>

                     <stRef:documentID>xmp.did:bd0834c1-20d8-4279-a27a-2435a16e3384</stRef:documentID>

                     <stRef:instanceID>uuid:fa7b3b48-334a-c846-bdd3-baac1be64ffc</stRef:instanceID>

                  </stMfs:reference>

               </rdf:li>

            </rdf:Seq>

         </xmpMM:Manifest>

 

 

<xmpTPg:PlateNames>

            <rdf:Seq>

               <rdf:li>Cyan</rdf:li>

               <rdf:li>Magenta</rdf:li>

               <rdf:li>Yellow</rdf:li>

               <rdf:li>Black</rdf:li>

               <rdf:li>AQ Free</rdf:li>

               <rdf:li>Dieline</rdf:li>

            </rdf:Seq>

         </xmpTPg:PlateNames>

 

I'd like to do this outside of Illustrator if possible. Maybe something like an Automator app / droplet where I can drop the file / files or run from a shortcut to have them batch processed?

 

Or maybe there's another way to do this entirely, I'm open to suggestions. Any help would be greatly appreciated! Thanks!

This topic has been closed for replies.