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
app.executeMenuCommand ('selectall'); (CTRL+A)
app.executeMenuCommand ('group'); (CTRL+G)
app.executeMenuCommand ('ungroup'); (CTRL+SHIF+G)
Copy link to clipboard
Copied
app.executeMenuCommand ('selectall'); (CTRL+A)
app.executeMenuCommand ('group'); (CTRL+G)
app.executeMenuCommand ('ungroup'); (CTRL+SHIF+G)
Copy link to clipboard
Copied
WOW PERFECT!!
thanks a lot dear works great
cheers
Suzan