Making all paths into a group without selection

I'm working on a script that will take every pathItem in a document and put it into a group (all pathItems in the document are groupless upon opening it, so there won't be other groups already in the document).
I have a script that creates a group, then puts the highest placed pathItem into the group. I just can't figure out how to have to grab all pathitems in the document, or loop this one action until everything is in a single group. Also the kicker is, as the title suggests this script has to work without selecting anything by hand first (in other words having to click something to select it). Now if there's was a way to select everything with a script that would be awesome.
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 this that 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 saddly it requires selecting so two scripts, two possible solutions. I'm just working on both until I can get one to work.
Any ideas?

var all = doc.pathItems[0]; // all paths in document
that's only the top most pathItem, change that to
var all = doc.pathItems; // all paths in document
...and loop thru "all" and move each inside 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<all.length; i++) {
        eachPath = all[i];
        eachPath.move (gi, ElementPlacement.PLACEATBEGINNING); // move all pathItems inside the group
else
    alert('no documents to process');
for this set up we will run into trouble if you have other groups with pathItems

Similar Messages

  • HT201317 How do I select all images in Photo Stream without selecting them individually?

    Rather than selecting 1000 images individually is there a way to select all of them in  one hit?

    iCloud only keeps photos in your photo stream for 30 days, but they will remain on your iPad (up to 1000 photos) until you delete them.  I believe Apple TV will only display the photos that are still in your photo stream, not photos earlier than 30 days ago.
    If the older photos are on your iPad, you could always open them on your iPad and use AirPlay to display them on your Apple TV.

  • How can I stop URL from loading when I paste it into a page without selecting a text field first?

    I'm using a chat where I often copy links; if I forget to click the text field when copying an URL, it opens, forcing me to go back manually, which is really annoying. Can I disable URL autoopening somehow?

    It's possible that you are having a problem with some Firefox add-on that is hindering your Firefox's normal behavior. Have you tried disabling all add-ons (just to check), to see if Firefox goes back to normal?
    Whenever you have a problem with Firefox, whatever it is, you should make sure it's not caused by one (or more than one) of your installed add-ons, be it an extension, a theme or a plugin. To do that easily and cleanly, run Firefox in [http://support.mozilla.com/en-US/kb/Safe+Mode safe mode] (don't forget to select ''Disable all add-ons'' when you start safe mode). If the problem disappears, you know it's from an add-on. Disable them all in normal mode, and enable them one at a time until you find the source of the problem. See [http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes this article] for information about troubleshooting extensions and themes and [https://support.mozilla.com/en-US/kb/Troubleshooting+plugins this one] for plugins.
    If you need support for one of your add-ons, you'll have to contact its author.
    If the problem does not disappear when all add-ons are disabled, please tell me, so we can work from there. Please have no fear of following my instructions to the line, as all can be easily undone.

  • How do I print all responses as pdf without selecting and printing just one response at a time?

    How do I print all responses as pdf forms without selecting and printing just one response at a time?

    Sorry this is not supported at this time. You can only download the responses as PDF one at a time.
    You can export the response table and print the whole table but if you want to print each response individually you have to do it manually. Sorry.
    Gen

  • Is there a way to download music from the cloud at one time without selecting each one individualy

    just looking to see if all your songs in the cloud can be downloaded into your device without selecting each one individually

    Hi smokea,
    If you go to More>Purchased>Music>Not on this Phone>All Songs, you will see a Download All button in the top right-hand side of the screen.
    (sorry about the info that was here previously)....
    Cheers,
    GB

  • Is there a way to change the duration of a group of selected clips all at once?

    Hi all,
    I'm working with good old Premiere 6 on Windows 7.
    Is there a way to change the duration of a group of selected clips all at once?  If I have a large group of clips in my timeline that are all the same duration, once I've selected them all in a group, can I somehow change the frame number duration of all the clips at the same time?
    I've found other things that can be done to a group of clips at the same time, but I can't find a way to change the duration of a group of selected clips.
    Thanks,
    digi

    Thanks Jim and Bill,
    In my efforts to work around the problems with the distortion and horizontal interlace lines that come when using the Motion Settings, I'm doing stop frame animation with hundreds and hundreds of layers in PSDs in multiple files placed in hundreds of one, four and six frame sections in Premiere, so if I find that I need to change the number of frames per clip in hundreds of consecutive clips (not actual duration of speed changes), then I need to pull out the right side of hundreds of frames after first moving them apart enough to allow for changing them if I'm making them longer.
    These animations are different from the rotating reel animations in that they are for laterally moving subjects that are long streams of moving graphics and photos.
    I read about "clip nesting", but I think that only applies to clips or groups of clips that are the same, whereas my clips are each from different imported layers times 125 or so, consecutively placed one after another to create the laterally moving stop frame animation.
    Now I've tried johnbmx4christ's alternate method of creating rotations that was just posted on the other thread about the rotation distortion, but that method results in the same oblong distortion and messed up looking horizontal interlace lines.
    What a can of worms.
    Thanks,
    digi

  • Illustrator 6.0 vector paths, when opened in Illustrator CC are now all broken into segments?

    Illustrator 6.0 vector paths, when opened in Illustrator CC are now all broken into segments at key points (ie. a circle, has become a series of 4 quarter circle lines. Has anyone experienced this and is there a quick fix? I still have both Illustrator versions installed and can go back to use the original files, however I'd like to upgrade smoothly without having to redo all my vectors!    

    That is strange sounds like what happens when you open a die built in autocad, in illustrator. What happens if you paste a CS6 path into CC?

  • When I go into my mail and select the sent item tab it boots be out. Without letting me view my sent email

    When I go into my mail and select the sent item tab it boots be out. Without letting me view my sent email

    Another easy thing to try is to quit the mail app completely and restart the iPad.
    Go to the home screen first by tapping the home button. Double tap the home button and the task bar will appear with all of your recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar. Restart the iPad.
    Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Did you send an email with a large attachment by any chance?

  • Finding duplicate path(object) without selecting

    Hi all,
    Is it possible to find the duplicate pathitem in the document without selecting those pathitems.It is possible to find the duplicate path items by selecting all the objects in the ducument,but i m not getting any clue to find the same without selecting.
    If it is possible then please give some suggestion on how to achive this ?
    Thanks,
    Sanat

    i might've misunderstood your question first time ... probably you`re looking to check if 2 objects are duplicates without creating the duplicate programatically. if so this might give you an inside look. test it by creating a shape, selecting it, copying it and pasting it in place ... you can play with the ignoreProperties string to make the comparison more general:
    var doc = app.activeDocument;
    var sel = app.activeDocument.selection;
    var ignoreProperties = "|name||width||height|";
    function AreDuplicates(o1, o2) {
        for(prop in sel[0]) {
            try {
                if(sel[0][prop] != sel[1][prop] && ignoreProperties.indexOf("|" + prop + "|") > -1) return false;
             } catch(er) {}
             finally { continue; }
        return true;
    if(AreDuplicates(sel[0], sel[1])) alert("Wheeee, they are sooooooooo duplicated!");
    else alert("Damn and i really hoped that ... never mind!");
    hope it helps;
    cheers;

  • Can I send a text to a "group" contact without selecting each individual member?

    Can I send a text to a "group" contact without selecting each individual member?  I have a group formed in my contacts, but I still have to select each member in that group to send a text or email from my phone.

    There are apps that allow you to address sms messages to groups (such as Speed Names: https://itunes.apple.com/us/app/speed-names-contacts-groups/id285124918?mt=8), but not iMessages.  Perhaps this will change with a future iOS update.
    The only point of having them at the moment is to allow you to limit the view to only contacts belonging to a group, so that you can more easily add the individual members of the group.  But at the present time, you still have to add them individually.

  • ICal for iPhone. View all events as a list without having to type into the earth box.

    iCal for iPhone. View all events as a list without having to type into the earth box.
    On the previous software version I used to be able to view all my calendar events as a list by clicking on the magnifying glass. Now you have to type into the search dialog box for a list to populate. This is very frustrating and annoying because I much prefer the list format to populate everything unless I specify what I am looking for into the search box. Is there a way to view all the events as a list without having to type anything into the search box?

    And you are aware of the possible options for listing the months and having an optional export value for each month.
    For listing the months, you can use a number, a 3 character string, or the full name.
    For the export value, the full name, the 3 character value, the 1-2 number, or the 0-11 JavaScript value.
    I would look at deciding how you want to populate the drop down box and build a one page form with just this field. You can then insert that page into a PDF and copy the field as needed and then delete the inserted page. Or you could create an FDF file to create the drop down box.

  • Select all paths of a specific color in one document

    Hi,
    I'm on Illy CS2, windows xp.
    I want to open a doc, run a script that selects all paths of a color, say 255,0,0 or 50,0,20,4 and changes that color to black or another color I specify and also changes the stroke. Is this possible? I can't see how i would do it?
    Thanks in advance,
    Stan

    Unfortunatly there is no getByColor method - below is a clunky way to get an array of objects that match a provided CMYK color : <br /><br />// Color you want to match<br /><br />myColor = new CMYKColor();<br />myColor.black = 50;<br />myColor.cyan = 0;<br />myColor.magenta = 0;<br />myColor.yellow = 0;<br /><br />foundObjects = getSameColor("ALL",myColor);<br /><br />function CMYKMatch(control,test)<br />{<br />     if (test.black == control.black && test.cyan == control.cyan && test.magenta == control.magenta && test.yellow == control.yellow)<br />     {<br />          return true;<br />     } else { <br />          return false;<br />     }     <br />}<br /><br />function getSameColor(type,color)<br />{<br />     var results = new Array();<br />     if (type != "FILL" || type != "STROKE" || type != "ALL")<br />     {<br />               myArt = app.activeDocument.pageItems;<br />               for(var i = 0; i<myArt.length;i++)<br />               {<br />                         if (myArt[i].typename != "TextFrame") <br />                         {<br />                              if (type == 'FILL' || type == 'ALL') {<br />                                   if (CMYKMatch(color, myArt[i].fillColor)) { results.push(myArt[i]); }<br />                              }<br />                              if(type == 'STROKE' || type == 'ALL') {<br />                                   if (CMYKMatch(color,myArt[i].strokeColor)) { results.push(myArt[i]); }<br />                              }<br />                         }     <br />               }<br />     }<br />     return results;<br /><br />}

  • I am trying to import photo's on i photo.  It downloads all of the pictures on my camera, how do i only select the photos i want?  Is there a way to do this without selecting one photo at a time? is there a way to select multiple images?  thanks!

    I am trying to import photo's on i photo.  It downloads all of the pictures on my camera, how do i only select the photos i want?  Is there a way to do this without selecting one photo at a time? is there a way to select multiple images?  thanks!

    To select consecutive images click and drag the cursor over multiple thumbnails to select all at once.
    To select multiple images that are randomly located hold down the Command(⌘) key and click on those images you want to select.
    Or to select consecutive images from a list of images that are together hold down the Shift key and and click on the first photo you want to select and the on the last photo you want in the list.
    OT

  • Why can't I delete all incoming messages at once without having to select each one first. It can be done while in the "Trash" folder, but not the "IN" folder.

    Why can't I delete all incoming messages at once without having to select each one first. It can be done while in the "Trash" folder, but not the "IN" folder.

    Well, what I see happing is this: Tapping edit and checking the first message brings up the “Delete” option. Holding it until the red message “Delete Message” appears, then letting go of the red button and tapping the checked button makes the “Delete Message” message go away. The checked message is still checked with an option to delete just that message. Tap the checked message again just cancels the whole process and I’m back to square one.
    However, if I check a message that is part of a thread of messages and tap Delete, I have the option of deleting all messages in the thread.
    Perhaps the fact that I’m using the 3rd generation of the iPad is the problem, but your suggestion isn’t working.

  • Path into selection

    Can someone refresh my memory on how to convert a path into a selection?

    There's no button on the paths pallette to convert a path Into  a selection.  In the path palette the path is labeled work path and when I right click the path, there's a "make selection" option, but it's greyed out.

Maybe you are looking for

  • Null value in a column

    i have few master tables in my database. Each master table has few records in it. Now i have to display all the columns which have a null value and this needs to be done by checking each record in that table. if there is any null value column for any

  • Digital touch is not working

    We bough to Apple Watch, sport and watch series for me and my wife. Everything works fine, but no digital touch. We both in friends (and we add and removed each other few times already), we both have this finger icon, but nothing we draw or tap is no

  • Hotkey preferences reset to default everytime I reboot

    I just got my first Mac ever (something I've been wanting since High School, but could never afford), and I absolutely positively love it. What was I thinking? Sticking with a PC for all these years?! Well, I have stumbled onto a little bug/issue. I

  • Polling

    Hello. Is it possible do a polling in the meanwhile the Labview is in a "while cicle" in which there is  a Elapsed Time Express VI. What I want to do is while I'm waiting for the responce of an instrument  at the same time do the polling of another o

  • Mac OS X Install Disc: 2Z691-6040-A

    Hi- I'm planning to upgrade my mini from OSX 10.4.11 (Tiger) to 10.5.x (Leopard) using Apple's:'Mac OS X Leopard 10.5 CPU Drop-in DVD: 2Z691-6040-A',which is compatible with my system a late 2006 Mac Mini 166GHz Core Duo. Prior to attempting the Leop