Skip to main content
Known Participant
July 1, 2011
Question

How to get applied graphic style name & symbol name from a document

  • July 1, 2011
  • 1 reply
  • 666 views

Hi,

   I need to get the name of graphics styles applied in a document. And also want to get applied symbol name from a document.  But don't know how to get the graphic style name.  Anyone know pls let me know.

Thanks,
Sudha K

This topic has been closed for replies.

1 reply

Larry G. Schneider
Community Expert
Community Expert
July 1, 2011

Here's a short method for writing out the Graphic Stlyes contained in the document. If you want just the ones used try running the Delete Unused Panel Items action first.

#target illustrator

var textFile = File('~/Desktop/Graphic Styles.txt');

var doc = app.activeDocument;

var docText = '';

for (var i = 0; i < doc.graphicStyles.length; i++)
     {
          docText += doc.graphicStyles.name + '\r';
     }

textFile.open('e');

textFile.write(docText);

textFile.close();

_______________

And here's a look at the text file

You should be able to do the same with symbols.

Known Participant
July 20, 2011

Hi,

   I need to get a graphic style name applied in a document.

  app.activeDocument.graphicStyles[0].name

   It gives the  graphic style name from the graphicStyle palete.  Dont  know how to get the applied graphic style name from the document.

If anyone knows pls let me know...

Regards,

Sudha K