Copy link to clipboard
Copied
Download Link
http://www.cyworld.com/be2u/2801831
Feature
This Script is Can be easily ungrouping to all group items in the Document.
if find Bugs or Error, contact to me plz.
License type
Freeware
Author
Nokcha
Author Contact
Author website
Date published
june 30, 2009
Compatible product
Illustrator
Copy link to clipboard
Copied
Hi
When calling the ungroup script with all top level layers of a document, those layers that have only one sublayer (and no immediate pageItems) will be removed.
To preserve top layers we adapted the getChildAll function to pick up layers as well:
function getChildAll(obj)
{
var childsArr = new Array();
for(var i=0;i<obj.pageItems.length;i++)childsArr.push(obj.pageItems);
if(obj.layers){
// Get layers as well.
for(var i=0;i<obj.layers.length;i++)childsArr.push(obj.layers);
}
return childsArr;
}
and in the main script we let layers make a call back to ungroup too, just as GroupItems do:
if(elements.typename=="GroupItem" || elements.typename=="Layer")ungroup(elements);
Best regards,
Andreas Jansson
Copy link to clipboard
Copied
Thank U for the script. I spent 6 hours to combine how to do it using while loop, but obj.groupItems.length doesn't refresh (obj = selected group)
Regards
Mateusz