Skip navigation
Currently Being Moderated

GroupItems are returning as Layers??

Apr 5, 2012 10:36 AM

I have a layer that contains two clipping groups (groups with a clip mask and other art).  When I call layer.groupItems it returns an empty array.  When I call layer.layers it returns the two clipping groups.  I need to know if these layers are clipping groups, but if they are coming back as layers how can I figure that out?

 
Replies
  • Currently Being Moderated
    Apr 5, 2012 10:59 AM   in reply to Meate

    Post a snapshot of your expanded layer palette or a link to a file from some web sharing site…

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 5, 2012 11:47 AM   in reply to Meate

    That won't pass a syntax check with those colons… What happens if you try this… Change my fluff for any name you like ( that's present in doc )…

     

    #target illustrator
     
    var doc = app.activeDocument;
     
    var sourceLayer = doc.layers.getByName( 'fluff' );
     
    var layPageItems = sourceLayer.pageItems;
    var layGroupItems = sourceLayer.groupItems;
    var layLayers = sourceLayer.layers;
     
    
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 5, 2012 12:38 PM   in reply to Meate

    ActionScript why didn't you say? I know nothing of ActionScript sorry…

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 6, 2012 1:13 AM   in reply to Meate

    I don't really know what I can add… I quickly made a doc that looks like your structure and slighty modified the above snippet to debug…

    All the results are exactly what I would expect? Is you dupe layer question also ActionScript?

     

    #target illustrator
     
    var doc = app.activeDocument;
     
    var sourceLayer = doc.layers.getByName( 'Layer 1' );
     
    $.writeln( sourceLayer.pageItems.length ); // returns 3
    $.writeln( sourceLayer.groupItems.length ); // returns 2
    $.writeln( sourceLayer.layers.length ); // returns 0
    

     

    Screen shot 2012-04-06 at 09.08.34.png

     
    |
    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