Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
3

All Group to Ungroup Script

New Here ,
Jun 30, 2009 Jun 30, 2009

logo.jpg

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

TOPICS
Scripting
13.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Beginner ,
Mar 26, 2018 Mar 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 12, 2024 Jun 12, 2024
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines