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

Group and Un Group

Participant ,
Apr 28, 2016 Apr 28, 2016

Copy link to clipboard

Copied

Hi all,

i'm trying to do a code can select all objects,text frames and layers then group them all (CTRL+A)+(CTRL+G) then i will add more steps

after that i want to do UN group again (CTRL+A)+(CTRL+SHIF+G)

i'm trying with this code but i see some layers not selected and not grouped, can someone help please

var doc = app.activeDocument; 

doc.selectObjectsOnActiveArtboard();    

   

    newGroup = app.activeDocument.groupItems.add(); 

     

    for ( a = app.activeDocument.layers[0].pageItems.length-1; a > 0; a-- ) 

     

    { 

              app.activeDocument.layers[0].pageItems.moveToBeginning(newGroup); 

    } 

Thanks a lot

TOPICS
Scripting

Views

456

Translate

Translate

Report

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

correct answers 1 Correct answer

Participant , Apr 28, 2016 Apr 28, 2016

app.executeMenuCommand ('selectall');   (CTRL+A)

app.executeMenuCommand ('group');   (CTRL+G)

app.executeMenuCommand ('ungroup');  (CTRL+SHIF+G)

Votes

Translate

Translate
Adobe
Participant ,
Apr 28, 2016 Apr 28, 2016

Copy link to clipboard

Copied

app.executeMenuCommand ('selectall');   (CTRL+A)

app.executeMenuCommand ('group');   (CTRL+G)

app.executeMenuCommand ('ungroup');  (CTRL+SHIF+G)

Votes

Translate

Translate

Report

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
Participant ,
Apr 29, 2016 Apr 29, 2016

Copy link to clipboard

Copied

LATEST

WOW PERFECT!!

thanks a lot dear works great

cheers

Suzan

Votes

Translate

Translate

Report

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