4

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?

2
  • 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, 2013 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, 2013 at 6:26

1 Answer 1

1

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++){
app.selection[i].doSomething;
 }

Hope it's work for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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