Skip navigation
LemonJoe
Currently Being Moderated

How to make JavaScript recognize  a group?

May 1, 2012 3:35 AM

Tags: #javascript #select #group

All the graphics in my document is selected. I want to deselect groups and leave standalone items selected. How can i make JavaScript recognize  a group? Thank you!

 
Replies
  • Currently Being Moderated
    May 1, 2012 7:41 AM   in reply to LemonJoe

    Something like this should do you…

     

    #target illustrator
     
    var doc = app.activeDocument;
    var sel = doc.selection;
     
    for ( var i = sel.length-1; i >= 0; i-- ) {
        if ( sel[i].typename == 'GroupItem' ) { sel[i].selected = false }
    };
    
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points