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

group objects on artboard

Explorer ,
May 27, 2013 May 27, 2013

When i call the method selectObjectsOnActiveArtboard on an artboard, is there a way to easily group all items in the selection?

Like in the menu found under "right click > group"

TOPICS
Scripting
1.2K
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

correct answers 1 Correct answer

Community Expert , May 27, 2013 May 27, 2013

Try this:

// GroupFromSel.jsx

// regards pixxxelschubser

if ( app.documents.length > 0 && app.activeDocument.selection.length > 0) {

    var aDoc = app.activeDocument;

    var Sel = aDoc.selection;

    var GroupFromSel = aDoc.groupItems.add();

    for ( i = Sel.length-1; i >= 0; i--) {

        Sel.moveToBeginning( GroupFromSel )

        }

}

Have fun

Translate
Adobe
Community Expert ,
May 27, 2013 May 27, 2013

Try this:

// GroupFromSel.jsx

// regards pixxxelschubser

if ( app.documents.length > 0 && app.activeDocument.selection.length > 0) {

    var aDoc = app.activeDocument;

    var Sel = aDoc.selection;

    var GroupFromSel = aDoc.groupItems.add();

    for ( i = Sel.length-1; i >= 0; i--) {

        Sel.moveToBeginning( GroupFromSel )

        }

}

Have fun

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 ,
May 27, 2013 May 27, 2013

Hi,

How to group "n" numbers of eps files in a folder?

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 ,
May 28, 2013 May 28, 2013

Working great, but I have changed moveToBeginning to moveToEnd because the order was not correct

Thanks

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
Community Expert ,
May 28, 2013 May 28, 2013
LATEST

You're welcome.

abjelly wrote:

… but I have changed moveToBeginning to moveToEnd because the order was not correct

Strange. Are you sure?

The (last) selected item is moved to the top position.

The (penultimate) selected item is moved to the top position … and so on ...

… the (first) selected item is moved to the top position.

The order should be all right.

Like this:

GroupFromSel.png

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