Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Ungroup all groups then create a single group

$
0
0

Hey

 

I'm having trouble getting a script together where I can ungroup all groups in a document, then put everything under a single group. Everyhting I'm working with has a single layer, but for some of the arts I'm importing have groups within groups ect. To run certain actions I've made properly after I need eveything to be in one, single group.

 

I searched for an answer and found this (wirtten by Carlos Canto)

 

function ungroup(whereToUngroup, group) // where to ungroup? layer, document, other group?

     {

          for (i=group.pageItems.length-1; i>=0; i--)

               group.pageItems[i].move(whereToUngroup, ElementPlacement.PLACEATBEGINNING);

     }

 

But I'm having trouble getting it to work.


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>