Skip to main content
Participant
July 1, 2009
Question

All Group to Ungroup Script

  • July 1, 2009
  • 2 replies
  • 13905 views

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

netbluew@gmail.com

Author website

http://be2u.tistory.com

http://www.cyworld.com/be2u

Date published

june 30, 2009

Compatible product

Illustrator

This topic has been closed for replies.

2 replies

Inspiring
June 12, 2024

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

Participant
March 26, 2018

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