Make a group without selection of all paths

I'm working on a script that will take each pathItem in a document and put it in a group (all pathItems in the document are groupless opening, so there won't be other groups already in the document).

I have a script that creates a group, and then puts the highest pathItem placed in the group. I just can't figure out how to retrieve all the pathitems in the document, or the same action in a loop until everything is in a single group. The kicker is, as the title suggests this script should work without selecting anything first hand (in other words, after click on an item to select). Now, if there was a way to select all elements with a script that would be great.

Here's what I have so far:

#target Illustrator
//based on script from Carlos Canto
var doc = app.activeDocument

if ( app.documents.length > 0 ) {
doc = app.activeDocument;
newGroupItem = doc.activeLayer.groupItems.add();
}

var gi = doc.groupItems[0]; // the topmost existing group
var all = doc.pathItems[0]; // all paths in document

all.move (gi, ElementPlacement.PLACEATBEGINNING); // move selected path inside the group
all.evenodd = true; // necessary to determine "insideness" or to make holes.

I also have what I found here on the forum

#target Illustrator
// 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 )
        }
}

But alas, you select so two scripts, two solutions possible. I'm just working on both until I can get one to work.

Any ideas?

var all = doc.pathItems[0]; // all paths in document

It's only the highest pathItem, that to change

var all = doc.pathItems; // all paths in document

.. .and loop thru 'all' and move each within your group

#target Illustrator
//based on script from Carlos Canto

if ( app.documents.length > 0 ) {
    doc = app.activeDocument;
    var gi = doc.activeLayer.groupItems.add();
    var all = doc.pathItems; // all paths in document

    for (i=0; i

for this configuration, we will run trouble if you have other groups with pathItems

Tags: Illustrator

Similar Questions

  • Change all paths in a layer without using a layer appearance attribute

    I suspect I did it wrong for a while, but I don't know how to do it right.

    If I want to change the appearance of all paths in a layer (say, something simple to change their line color), it is pretty easy to target in the layer by clicking on the button of the target layer. However, when I do change (as outline in orange color setting), it appears in the appearance of the layer itself - each element within the layer are not orange line directly in their appearance attributes, they just inherit the appearance of the layer attributes.

    I understand that this is the intended behavior, but I found that it's easier for me to avoid the layer effects and have just each element in a layer to be autonomous and show all its own attributes of appearance without something inheriting from the upper layer (I tend to forget and be confused about when they appear). However, I don't know how to force the appearance of a layer down to its subcomponents (likely the compensation of the appearance of the layer to avoid duplication). Is it some commands I'm missing?

    Now how I do it, it's all in the layer by using the layer target, then UN-target target the highest member of the layer. This allows me to change the appearance of all items in the layer (except the one at the top) without changing the appearance of the layer itself. Then I do the top separately. Seems kludgier than she should be. Any help? Thank you.

    tqrtuomo, I was confused by the present, sometimes as well and made the same thing you describe. I think the key, when selecting on a given layer or group is to click on the 'right' of the 'Target' button in the layers panel to the layer/group level. Make sure that there is no 'circle' around the target button or appearance will be assigned to the layer/group.

  • Make a group of clipping with a compound path

    So, as of today, I am new to scripting for Illustrator, I use the ExtendScript Toolkit. However, I am not new to my own script solutions and I do not have any experience with JavaScript.

    What I'm trying to do is the following: for all selected items-> duplicate selected item and make a group of simple clipping with it

    What I'm left with visually does not change the picture, but gives me a lot of clipped colored areas that I then can I change in isolated mode, which allows me good shading faster and better. That the doing by hand takes hours on some pictures, it would take a second with a script.

    The script itself is already works for normal PathItems. As evident in the title, as soon as I have to apply the same thing to CompundPathItems things stop working. My question is a bit like this old thread [problem with clipping path transparent], but I couldn't find a solution because I get different behavior.

    When I run the same script that works perfectly with the normal PathItems with CompoundPathItems I get this: 9046 error: the top element in the group must be a path element to create a mask

    Well, it's a problem. There is absolutely no difference between making a clipping with a simple path mask and a compound path in the GUI. Frankly reference guide not helped with this problem at all, the only thing that I learned from it is that the CompoundPathItem object is an attribute of cutting, but those included PathItems.

    Here's what I have so far:


    If ([i] selected. TypeName == 'PathItem') {}
    newGroup var = doc.groupItems.add ();
    copy is selected [i] .duplicate (newGroup, ElementPlacement.PLACEATEND);.
    Selected [i] .moveToBeginning (newgroup);
    newGroup.clipped = true;

    }

    As I said, this part is exactly what it is supposed to do for normal paths.

    For CompoundPaths, I use this work around.

    If ([i] selected. TypeName == 'CompoundPathItem') {}
    newGroup var = doc.groupItems.add ();
    copy is selected [i] .duplicate (newGroup, ElementPlacement.PLACEATEND);.
    Selected [i] .moveToBeginning (newgroup);
    compoundItems = selected [i] .pathItems;
    compoundIndex = compoundItems.length;
    for (f = 0; f < compoundIndex; f ++) {compoundItems [f] .clipping = true ;}
    var lineList = new array (10);
    for (l = 0; l < lineList.length; l ++) {lineList [l] = new Array (I * 10 + 50, ((i-5) ^ 2) * 5 + 50) ;}}
    newPath = app.activeDocument.pathItems.add ();
    newPath.setEntirePath (lineList);
    newPath.moveToBeginning (newGroup);
    newGroup.clipped = true;
    newPath.remove ();

    Mind you, this workaround works in so far that it ignores that annoying error and evil and composite clipping path also works with the only problem being that created composite clipping path as it is always displayed in its original colours in the layers section and is always selectable. When I lock the composite clipping path I can work with it, but still...

    So the question is, what am I missing here? Surely, there must be a good way to do this.

    app.executeMenuCommand ()? That is me away so far, might be just the right thing. I will definitely take a look, now just to find a ref about it, because unfortunately official documents Ref I do not mention this command. Any place with a list of possible commands?

    Ah, also of course I only do for the isolation mode. If you care to hear the background, it is here:

    As I said it's for photos of shading, I'm working on. I repeated and tried through a bunch of techniques. For example, gradient mesh on my first few true works. Now these cracks don't do well with complex shapes, which previously I mitigated by using a simple square or rectangle gradient mesh and using the original form as a color clipping mask. It worked, but it was a huge field of work.

    After a lot of attempts that I went to the use of simple gradients as a background for the form, and then I do the shading freehand with the blob Brush tool, using a graphic style and filters to make it look like to the right. Is better, but do it right all the clipping masks takes me much more time than anything else.

    Now the problem is that shading is not supposed to cross the lines, it's impossible to do correctly without messing up the order, either using clipping masks, where the script. Because you know, if you use a form of the task with a strong Gaussian blur near the lines, you'll find yourself with stuff on both sides. If you do not start close to the line that the shading will be not look right if the darker the shade needs to be close to the line. And that's where magic of clipping masks.

    And finally, here's an example of how I work with the script and the result:

    After that I drew a sketch, adjust the line widths and at the neatness I turn the paths to sketch the lines and then turn them into a live paint Group (which would ruin the line widths, unless you put the paths in first contour lines).

    With this live paint group need me a few minutes to color my piece dish. Then I develop the live paint group, in case of doubt, spend a few more minutes to make transparent traces of all regions, I need the shadow in one piece, and then I select all areas and use my script to activate the neat clipping masks. Then I can click on any field, enter the isolation mode, and go up one level, so I'm in the appropriate group, where I can shadow freely without the problem beyond the lines.

    At the end which allows me to apply shading complex and comprehensive, without wasting time to get there.

    PS: well, I just found out that draw inside is really close to what I want to do, and oddly enough, it produces the same Visual discrepancy with transparent traces that produces my script. I'll take a closer look that, while my script is a little more than just the stuff of clipping mask, so maybe I'll go for a hybrid solution. Everything that makes for a better workflow.

  • How to select multiple lines of text (without selecting all the text) within a title? (Holding Cmd does not work)

    I need to select several lines of text (in the various sections of the text) within a title without selecting any text. Holding Cmd like you would in other applications does not work, and now Shift selects all. Does anyone have a solution?

    Thank you.

    YYou cannot select several segments of text in a text block.

  • I have a distribution list large email I want to create, BUT I don't necessarily want to put in my Contacts and all this My Contact list of people synchronized upward with my iPhone. Can I create a group without their input in my Contacts?

    I have a distribution list large email I want to create, BUT I don't necessarily want to put in my Contacts and all this My Contact list of people synchronized upward with my iPhone. Can I create a group without their input in my Contacts?

    You can create another account on your mac.

    You can open an account with mailchimp.

    There may be a limit on the number of emails you can send per day. No idea about the number, but I've heard as low as 200 per day.

    R

  • AnyConnect tunnel-group automatic assignment without selecting any group-tunnel-group-list alias and user-group strategy.

    Objective is that the anyconnect user must select group-alias, so that when a user enters his username and password he must go to his political group and tunnel-group specific. as I removed this command in webvpn 'no tunnel-group-list don't enable '. This I can not connect (user does not authenticate).

    1 - my question is why his past does not?

    Solution:

    If I keep only a single tunnel-group by default and make several group policies and assign to each user with his specific group policy that it works. in user attribute means I have only question following the commands it works, but if I put "group-lock value test-tunnel" that it did not identify.

    Please explain why.

    WebVPN

    allow outside

    limit the cache-fs 50

    SVC disk0:/anyconnect-win-3.0.10055-k9.pkg 1 image

    enable SVC

    internal strategy of group test-gp

    attributes of the strategy of group test-gp

    VPN-tunnel-Protocol svc webvpn

    the address value test-pool pools

    username, password test test

    username test attributes

    VPN-tunnel-Protocol svc

    group-lock value test-tunnel

    Strategy Group-VPN-test-gp

    tunnel-group test-tunnel type remote access

    attributes global-tunnel-group test-tunnel

    Group Policy - by default-test-gp

    tunnel-group test-tunnel webvpn-attributes

    allow group-url https://192.168.168.2/test

    Yes, you have the right solution. You only need to create 1 group of tunnel and multiple group policy. Under the attribute of the user, you re then group policy of vpn that you want the user assigned too.

    You can also authenticate users against AD and configure ldap attribute map to map the user to a specific group policy automatically.

    Here is an example of configuration if you happen to have the AD and will authenticate against AD:

    http://www.Cisco.com/en/us/products/ps6120/products_configuration_example09186a00808d1a7c.shtml

    Hope that helps.

  • How to make my site in a mobile site without doing it all again

    How to make my site in a mobile site without doing it all again? Please fern

    Hey fern,

    Currently, it is the only way to do so.

  • How to hide all paths without widening the palette?

    It is something that I have wondered about for years:

    You know how you can deselect one way 'sex' (for lack of better word) in the palette drawn by clicking in the empty space of the paths palette? What happens if your pallet traced has saved paths as long as there is no space empty to click in? I know that I can just to expand the palette, but I don't want to have to do that, because all my palettes are solidly organized in a giant wall o ' pallets on a second monitor. Is there a way to hide all paths without having to expand the palette to bring up the empty space?

    If it is not currently using a tool running on trails, activate one, for example, press a key. Now, press ESC to untarget all paths.

  • How to make a list of check boxes where exactly 2 must be selected at all times?

    I want to have a list of checkboxes or radio buttons, where exactly 2 options must be selected at all times. At the present time, the list has between 2-4 options enabled (according to other parts of the program). How is that possible?

    -James

    Sorry if this seems obvious - I couldn't find apparently relevant information on this topic.

    Here's a simple demo using Enums and the disabled items property.  You can extend the method to disable the value 2 and set of waveform to 0 and 1 when necessary (attached to 8.5) PNG of 2011 (not an extract due to p-nodes)

  • Can I click on an object as a starting point for slide without selecting it?

    Hello

    I would like to know if there is a way to begin to drag the point on the surface of an object without selecting it.

    Thank you in advance.

    It would have helped you said what tool you drag with.

    like making a rectangle that represents the area of selection

    You're talking about what we call to make a selection rectangle.

    I'm looking for a way if I can just click on a surface of an object without actually clicking on it so I can just start dragging carefully.

    Read what you just said: '... ". Click on a surface of an object without actually clicking on it... »

    What you ask is really: is there a way of mousedown on an object with one of the selection pointers without selecting the object, in order to begin a selection rectangle?

    This is essentially what the Lasso selection tool. But it is not rectangular selections and cannot be forced to do so (no 'elastic' modifier as in Photoshop). He also disrespects of clichés, if it's important to what you're trying to do. Nor can he will strive to select entire paths he touches by pressing the Alt key, as can be done with the white pointer.

    We could probably expect black and white pointers to work like this:

    1. click on an object. (The object is selected.)

    2. press SHIFT and mousedown (not mouseup) on the object. (The object becomes unchecked.)

    3. start to drag. (Starts a selection rectangle).

    But they do not.

    Selection of Illustrator pattern is and has always been the worst class among public drawing programs. Needless to multiple tools, badly implemented, that all together can not do a single tool can do in other programs.

    Much trouble of selection is avoided in other programs by providing a "touch sensitive" toggle in other words, the ability to define a selection tool to select all its renowned keys, (such as Illustrator) or to select only objects that completely surrounds the marquee.

    For a long time, I suggested that we should be able to "convert" any path given to a selection or a path to the Cup. (Illustrator may not correctly cut its own paths, either.)

    IE7

  • Photoshop CS3 will not change a selection into a path

    The title pretty much everything said.

    I make a selection, change the path tab, click the button of "Doing the work of path selection" and my path disappears.

    It's Photoshop CS3.

    I'll try to remove my preferences and see if it works.

    Delete preferably worked. Apparently Photoshop got all confused.

    On a Mac, hold down the command, Option, shift keys when you start Photoshop. On a PC, I think it's CTRL-ALT-Shift.

  • windows vista 64-bit vista need upgrade Express dvd, but can't without a yellow sticker? is - this saposed to be somewhere on my pc? or on the vista cd case? and how to make the upgrade without the sticker? __

    need vista in windows vista 64-bit upgrade Express dvd, but can't without a yellow sticker? is - this saposed to be somewhere on my pc? or on the vista cd case? and how to make the upgrade without the sticker?

    32-bit to 64-bit is NOT an upgrade path.

    It must be done with a clean installation using a Vista FULL 64-bit disk/license.

    Buy a version of disk/license FULL Vista 64 bits of your local computer, or online store: amazon, newegg, etc.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    If you already have a version of Vista Home 64 bit, here's how to buy Vista 64 bit Ultimate Anytime Upgrade:

    http://www.Microsoft.com/Windows/Windows-Vista/get/Anytime-Upgrade-overview.aspx

    See you soon. Mick Murphy - Microsoft partner

  • Payment service returns 'purchase successful' without selecting the mode of payment (in sandbox mode)

    Hello

    I'm testing in-app purchase in my app (BB10). I added my id in sandbox mode. I go through all the messages of payment and without selecting any mode of payment (paypal/credit card), it returns successfully. is this correct behavior?

    There is free of charge with the sandbox test, so flow you state sounds as it should. Direct mode test load actually does more validation would occur before returning a result.

  • How can I make changes to my list of 'all programs '.

    It seems that whenever I install a new game, the file will appear in the menu in 3 places. I would like to streamline the menu, but I can't figure out how to make the changes without going and change them one at a time. Is there a way to open the file "All programs" to make the changes? I can do it with the option "Open All Users", but it only changes to the menus individual user.

    Click Start and click all programs, and then click Open.

    Good luck.

  • What privileges granted to select from all the PDB files

    Why the two selected does not return the same result? Or if you want the broader question - what privileges granted to select from all the PDB files.


    I want to leave common user that I created to select and see all of the synonyms of all PDB files.


    conn / as sysdba

    create user c##nir identified by c##nir container=all;

    grant connect,dba,resource to c##nir container=all;
    grant select on cdb_synonyms to c##nir container=all;

    select CON_ID  from cdb_synonyms  group by CON_ID;

      CON_ID
    ----------
      
    1
      
    4
      
    11
      
    10
      
    14
      
    5
      
    8
      
    13
      
    3
      
    7
      
    15
      
    6
      
    12
      
    9

    conn c
    ##nir/c##nir

    select CON_ID  from cdb_synonyms  group by CON_ID;

      CON_ID
    ----------
      
    1

    select CON_ID  from containers(dba_synonyms)  group by CON_ID
      
    *
    ERROR at line
    1:
    ORA-00942
    : table or view does not exist

    You must use the CONTAINER_DATA clause:

    ALTER USER ##nir set container_data = container c all = current;

    After running the above command, try to select again to cdb_synonyms and you will see the data of all containers.

    Read more in my Post of Blog

Maybe you are looking for