objects in Group on the artboard

When I call the method selectObjectsOnActiveArtboard on a work plan, is there a way to group easily all items in the selection?

As in the menu under "right click > Group.

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[i].moveToBeginning( GroupFromSel )
        }
}

Have fun

Tags: Illustrator

Similar Questions

  • Moving a group to the artboard using javascript

    I have a group that I want to focus on the artboard.  Help, please.

    You can use the move() method, but it's easier to use

    yourGroup.position = [x, y];

    Edit:

    position of the object's coordinates left/up

  • Script to make an object the size of the artboard.

    I'm looking for help to try to be a subject of the exact size of the artboard.  It's something I do on a daily basis for many different reasons, and it would be very useful if this can happen automatically for any size would be the artboard.  If I understand the only way is a script but I have no experience with no shooting scripts illustrator, im certainly no programmer.  I put in place in the past to copy since the entries on the artboard when you are on the work plan tool, but these rounds to la.01 the closest quickkeys and is not sufficiently precise so that I work with.  Also, if I do this with several pages open illustrator is very slow to respond to the work plan tool.  If anyone has any idea where to start or saw these other scripts I'd be very happy.  Thank you.

    Here is a script that I've seen here that I believe can contain what I need but now knowing I have no idea where to start on changing the programming.  All I need is the part where an object is placed on the artboard that is the same size as the artboard.  If someone can advise on editing I apprecaite it.

    #target illustrator

    function main() {
         if (app.documents.length == 0) {
              alert('Open a document before running this script');
              return; // Stop script here no doc open…
         } else {
              var docRef = app.activeDocument;
              with (docRef) {
                   if (selection.length == 0) {
                        alert('No items are selected…');
                        return; // Stop script here with no selection…
                   }
                   if (selection.length > 1) {
                        alert('Too many items are selected…');
                        return; // Stop script here with selection Array…
                   } else {                   
                        var selVB = selection[0].visibleBounds;
                        var rectTop = selVB[1] + 36;
                        var rectLeft = selVB[0] - 36;
                        var rectWidth = (selVB[2] - selVB[0]) + 72;
                        var rectHeight = (selVB[1] - selVB[3]) + 72;              
                        selection[0].parent.name = 'CC';
                        selection[0].filled = false;
                        selection[0].stroked = true;
                        var ccColor = cmykColor(0, 100, 0, 0);              
                        var ccCol = spots.add()
                        ccCol.name = 'CC';
                        ccCol.color = ccColor;
                        ccCol.tint = 100;
                        ccCol.colorType = ColorModel.SPOT;
                        var cc = new SpotColor();
                        cc.spot = ccCol;                   
                        selection[0].strokeColor = cc;
                        selection[0].strokeWidth = 1;                   
                        var tcLayer = layers.add();
                        tcLayer.name = 'TC';
                        var padBox = pathItems.rectangle(rectTop, rectLeft, rectWidth, rectHeight, false);
                        padBox.stroked = false;
                        padBox.filled = true;
                        var tcColor = cmykColor(0, 100, 90, 0);         
                        var tcCol = spots.add()
                        tcCol.name = 'TC';
                        tcCol.color = tcColor;
                        tcCol.tint = 100;
                        tcCol.colorType = ColorModel.SPOT;
                        var tc = new SpotColor();
                        tc.spot = tcCol;
                        padBox.fillColor = tc;    
                        padBox.move(docRef, ElementPlacement.PLACEATEND);
                        artboards[0].artboardRect = (padBox.visibleBounds);
                        redraw();
                        rectWidth = (rectWidth-72)/72;
                        rectWidth = roundToDP(rectWidth,1);
                        rectHeight = (rectHeight-72)/72;
                        rectHeight = roundToDP(rectHeight,1);
                        var textString = rectWidth + ' x ' + rectHeight;
                        prompt('Copy Me', textString);
                   }         
              }
         }
    }

    main();

    function roundToDP(nbr, dP) {
         dpNbr = Math.round(nbr*Math.pow(10,dP))/Math.pow(10,dP);
         return dpNbr;
    }

    function cmykColor(c, m, y, k) {
         var newCMYK = new CMYKColor();
         newCMYK.cyan = c;
         newCMYK.magenta = m;
         newCMYK.yellow = y;
         newCMYK.black = k;
         return newCMYK;
    }

    Here you go, select an object before you run, if your art is more than an object, first make a group.

    #target Illustrator
    
    //  script.name = fitObjectToArtboardBounds.jsx;
    //  script.description = resizes selected object to fit exactly to Active Artboard Bounds;
    //  script.required = select ONE object before running; CS4 & CS5 Only.
    //  script.parent = carlos canto // 01/25/12;
    //  script.elegant = false;
    
    var idoc = app.activeDocument;
    selec = idoc.selection;
    if (selec.length==1)
              {
                        // get document bounds
                        var docw = idoc.width;
                        var doch = idoc.height;
                        var activeAB = idoc.artboards[idoc.artboards.getActiveArtboardIndex()]; // get active AB
    
                        docLeft = activeAB.artboardRect[0];
                        docTop = activeAB.artboardRect[1]; 
    
                        // get selection bounds
                        var sel = idoc.selection[0];
                        var selVB = sel.visibleBounds;
                        var selVw = selVB[2]-selVB[0];
                        var selVh = selVB[1]-selVB[3];
    
                        var selGB = sel.geometricBounds;
                        var selGw = selGB[2]-selGB[0];
                        var selGh = selGB[1]-selGB[3];
    
                        // get the difference between Visible & Geometric Bounds
                        var deltaX = selVw-selGw;
                        var deltaY = selVh-selGh;
    
                        sel.width = docw-deltaX; // width is Geometric width, so we need to make it smaller...to accomodate the visible portion.
                        sel.height = doch-deltaY;
                        sel.top = docTop; // Top is actually Visible top
                        sel.left = docLeft; // dito for Left
    
              }
    else
              {
                        alert("select ONE object before running");
              }
    
  • How can I preview of objects that are outside of the artboard.

    Hello

    When I placed an illustrator file in Indesign, I would choose cmd + D > select "Show Import Options" and we have a preview of the image. On some occasions, the preview will include all foreign objects that are outside the artboard and other times, it only displays the image within the artboard or the bounding box. (See attached examples)

    Anyone know the reason behind this?

    Thank you

    Sutagami

    The only way I can reproduce what you feel is if I save to an .eps and am not aware of the artboard check box on the save dialogue. If you deselect this checkbox you will get all the content in the file, if you select this check box, you will only get the bounding box designated on the artboard. But you never said what you are recording format or what version of Illustrator that you use. I have to assume you are in CS4.

  • Work plans: selection of the artboard and unlock automatic disabling shapes in the work plans - possible?

    Hello

    I easily through the General work plan, and I saw immediately, so I thought I'd put it out there. Here are my two questions:

    1. is there a way to disable the ability to move a work plan while working in it? Essentially, to block the plan in place, but not the items it contains? If you use the automatic selection and slightly approach the edge of the plateau, then swipes the entire Board rather than just a few layers / items you want.

    2 is there a way to auto unlock all layers, including forms? It can be really frustrating for fish through the layers to find the form locked in order to remove a work plan. Command + / has not worked for me when I closed a single object manually.

    Thank you very much! I hope that these are not repeated questions.

    1. Yes. Use 'Position Lock' on the layer of the artboard properly said.

    2. Yes. Select the parent group or the artboard. While holding down the alt/option key, choose "Lock all layers in artboard...» "in the drop-down menu Layers Palette.

    This should unlock all layers inside this group or the artboard.

    (Probably, the fact that the menu does not change when you hold down the alt key is a bug, but it does not)

  • Adding actions to the artboard to Action?

    Here's what I want to do action:

    Delete the selected object

    Adapt to the artboard on the selected object

    Save for Web and devices

    I can get it to clear and save it, but I'll be darn if I can get the adjustment of the artboard on the selected object to register for the registration of the action.  Any shortcuts that I use, I use it just menus won't save it.  Is this just something Illustrator won't do or no matter what I just missed something?

    I do these 3 things listed above ALL the time and it would be nice it I could do these 3 things in 1 action, then add this action to a key on my tablet.

    Thank you.

    you use "Insert Menu Item" in the drop down palette from the Action menu?

  • Align all objects on the artboard, as if they were a group

    AI CS5.1. Bringing together a bunch of objects destroyed their classifications of layer, so how can I select the entire document on my page, treat it as if it were a group and swivel on the artboard?

    The best way to focus a group of objects on the artboard is concluded [width of graphic Board / 2] in the X coordinate and [height of work plan / 2] in the coordinate Y of the Transform palette. Make sure you have the Center selected as your point of reference in the Transform palette point.

  • Layer mask groups converted from work plans to the size of the artboard in older versions of Photoshop

    I wanted to start this post as an idea, but I couldn't choose communities (it wouldn't let me), so here it is posted...

    ----

    Just came across this with a customer...

    I use for a mobile design project work plans, and I just got a screenshot with some texts asking why among work plans were really great. Way bigger than a phone. (I'm under NDA and cannot post the screenshot, but imagine there are a lot of iPhone size work plans and two of them seem to be at a right angle)

    I opened the file and on my end, everything is the right size. Remembering the weeks ago to tell the customer that they need to update their version of Photoshop for all this work correctly, I have take a look at the screenshot and see that they are on CC2014 - none of the work plans.

    What I'm asking here, is that, since we have data, plans of work are objects of a defined size and 'alive', why not just use these data to hide layer groups at the opening of the PSD / PSB (PSB in my case) in older versions of Photoshop?

    It could save you a TON of hassle and confusion.

    Hi Zack,

    High level to your query response is: no, there is no conduct business case for a general solution to what you are suggesting. So I don't see what is happening.

    I say that as someone who likes to give back and forth and backward compatibility.

    There are two parts of the problem that you raise. They are related and somewhat intertwined.

    1. Having the version previous (2014) do something reasonable with the data from the version the most recent (2015). Either the old version should be taught on the most recent data so it can make a decision about what to do, or the newer version must put additional data in the file format for consumption by the older version.
    2. Back and forth between versions. As you say, a much more difficult problem. In fact, we do a good job of that today. But we must be sure that whatever we do for (1) not to damage and back the wrong way.

    Let's be very clear: 2014 will not be touched, except for critical bugs, absolutely. And even before 2015 is released, it would have not been corrected to make it behave better with work plans. There is no way that I could see what is happening. So all we have done for better backward compatibility had to be entirely done within 2015.

    For the round trip, the general problem is something like this: we want to 2014 to read an object that has properties of 2015, he does not understand. While we might learn ch to keep these properties as opaque property, must also have rules for when these properties are not valid and thrown on the floor. Probably, if the object is changed. But not always. And sometimes when another object parent is changed. And so on. Right now, we destroy them unknown content from their reading in the old version. Make us and record what we understand. As a user, you receive an alert telling you that we are do this. It's the safest thing to do.

    There are special cases where a developer can see an opportunity to preserve a level of backward compatibility and back and forth. We try to do if we believe that it is safe. But this scenario happens only occasionally.

    In the case of work plans, made us really think about this: If we added a mask to the group for backward compatibility, it should do something with this mask reading around 2015. And what would happen if the user edited this mask in 2014 and opened upward in 2015 - and who edited mask do not align with the structures of the artboard? Things started to get dark quickly. We started to see traps. The workflow together to sheath special round trip had to be tested and verified. The cost was rising and this expense must be filtered through a cost/value trade-off. And then what happens when we add a new property to the structure of work plan? At these efforts for nothing?

    So we compromised with what you have today. Work plans become groups in 2014. The Group and the layer structure remains intact. Doesn't secretly add us and remove masks for the round trip. You can safely change the groups to your heart's content. When return you this document in 2015, you redo the work plans of the groups. Was not clear and safe way to do more than that given the time that we had.

    Take a step back and think about your problem, it doesn't seem to be a value to a script that converts group work plans + layer masks for your workflow to have your documents that is consumed by the customers of 2014. This would be carried out in 2015 because she would need understand the work plans. And maybe vice versa from 2014 to 2015, assuming that the documents were not published in a hostile way. We're not likely to write such a script as a generic tool, but someone competent with script might be able to do this.

    More that I intend to write, but hopefully, it gives you additional insight in the compromises that we have faced.

  • Failed to open object of group policy on this computer. Do not have the appropriate rights.

    Hey all the...

    Today early in the morning, I opened my local Group Policy Editor and make some changes as I prevent users to access any drive on my computer, I enable "restrict all drives". do not forget that I do these settings as an administrator, because my computer has just a user account and this is my own account I mean administrator. So when I close the strategy group, then after my right-click was also spent with these settings. and now I am trying to open the Group Policy Editor to edit my previous settings. mean now I want to disable "restrict all drives".

    Whenever I want to open my my computer Group Policy Editor to display a few errors. I have post here in pictures.

    Failed to open object of group policy on this computer. Do not have the appropriate rights.

    After below error dialog box (1st photo).

    Group Policy Editor opens but shows nothing (2nd photo),

    Please help me as soon as possible...

    You did something different this time.  Basically, you options are only for updating the operating system.

  • I don't see Smart Guides around all the objects on the artboard even if the guides are checked in view

    Hello

    First of all, I don't pretend to be some illustrator expert but I have a good understanding of the functions of Adobe Illustrator key.

    However, when I went to design a logo yesterday, I don't see smart guides (blue lines, see below with all selected items) around all the objects on the artboard even if the guides are checked in order. I do not expect the controls on each being showing unless they are selected, but I do that I expect to see the blue line itself.


    Picture1.png

    I contacted the Adobe Illustrator Chat but really, they do not seem to have a clue and seemed to be intentionally misunderstanding me despite the fact that I sent this image. They were also quite rude!

    In any case, I'm now desperate so someone here can help me please.

    Thank you very much

    Mike

    PS I looked everywhere online for a solution and tried some of those suggested but without success.

    You may not see an unselected object with no line or fill in preview mode (this is why it is called overview).

    You can select it when you don't have fill and stroke in the tools Panel and choose: select > same > background & contour.

  • Objects/shapes emerging not anywhere on the artboard or other shapes/objects.

    The video with the star shows that objects align with the center of the artboard or edges as he usually does.

    The other video shows how similar features with other shapes/objects no longer work.

    I am running OSX El Capitan on an iMac 27 "2013, with the most current version of Illustrator CC.

    Here are the screenshots of setting relevant. I would like to know if there is anything you need to see.

    Screen Shot 2016-02-21 at 2.07.33 PM.pngScreen Shot 2016-02-21 at 2.07.58 PM.pngScreen Shot 2016-02-21 at 2.08.41 PM.pngScreen Shot 2016-02-21 at 2.09.28 PM.pngScreen Shot 2016-02-21 at 2.10.43 PM.pngScreen Shot 2016-02-21 at 2.10.29 PM.png

    Thanks for your help.

    Select view > bearings commented on to turn on the snap.

  • Opens a file someone else you want to resize an object, it is larger that the artboard, how can I get rid of the artboard

    Opens a file someone else you want to resize an object, it is larger that the artboard, how can I get rid of the artboard

    Marvin,

    You can view > hide the work plan, but why not just put to adapt to what you want?

    You can do this in the file > format Document, or with the tool of workplan according to version.

  • How to center the object between two guides (or a guide to the edge of the artboard)

    Simple question: How can I Center an object between two guides or between a fence and the edge of the artboard?

    Chris,

    You can (guides are your friends):

    (1) create a rectangle between two Guides or between the fence and the edge of the artboard by ClickDragging with the Rectangle (desired penalty) tool on a (location) on the other Smart Guides say path/path or page/path when you're there;

    (2) select the two rectangle of 1) and the object, and then click the rectangle, and then use the options in the align palette.

    Who should move your object in the Center in the direction you choose.

  • Alignment of Group at the centre and at the bottom of the artboard?

    How can I align a group of shapes in the Center and at the bottom of the artboard? I select forms, group them and choose horizontal centering and vertical align the base, although nothing is happening.

    You must check "Align to the work plan" first of all, it is located in the lower right of the palette of transformation. If you don't see it, click on the fly on the menu and choose "options".

  • Objects of AI distribution 2015 CC shifts the elements on the artboard

    I have four vertical lines selected, I click on distribute horizontally. The two elements are shifted to the left and right side of the artboard. The two elements should not move. Is this a bug?

    Sounds like you have enabled snap to the artboard in the align palette.

    Use instead align the selection .

Maybe you are looking for