Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a script to automate scene states. I using graphic styles to change appearance. How do I get object's graphicStyle? Is there a way to have a collection of objects of chosen style?

share|improve this question
Can't play around in Illustrator right now to give a specific answer. But I'm looking at the Scripting Reference... does the length property, or such methods as getByName or index get you close to what you need? I know that Illustrator scripting can be really frustrating and Adobe's documentation isn't all that helpful :( – Brendan Sep 20 '13 at 18:31
@Brendan I have read documentation and realize that graphicStyles (getByName and index) is returning not groupItem as it is said in the documentation, but graphicStyle. – amrok Sep 23 '13 at 6:26

I don't know what you make with all objects, but if you wuold select all item with same graphic style you can use app.executeMenuCommand('Find Style menu item'); script after selection active on one object with choosen style.

For example: choose 1 object and launch this script:

app.executeMenuCommand('Find Style menu item');
for(var i=0;i<app.selection.length;i++){

Hope it's work for you.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.