A script to do all my layers into individual groups of live paint?

Hello!

I am an architecture student and I often bring into my AutoCAD drawings into Illustrator to color / adjust the lines. A file from CAD can often have 30 + layers (one for the exterior walls, one for the interior walls, one for windows, one for the furniture and so on). When I apply the paint directly to a layer, I have to select and click alt + ctrl + X which is not only a lot of work but when you do it 20 times at the beginning of each drawing, it becomes a bit of a hazzle.

I was wondering if anyone know or can create a script that can transform all my layers (or at least the links selected) in individual groups of live paint? I know that I can select all via target select and click Live paint, but that creates a live paint group with all my layers. I want that all my 30 processed layers in 30 different live paint groups while running a script.

Anyone know?

If you use CC, you can be lucky with this one:

#target illustrator
function test(){
    function hideOtherLayersInCollection(layers, layer){
        for(var i=0; i 0){
        var doc = app.activeDocument;
        var eligibleLayers = [];
        for(var i=0; i 
         

Tags: Illustrator

Similar Questions

  • move all the layers into a single layer

    Hello

    I am new to the script and I need to make a script that the passage of all the layers into one layer (in Illustrator I press CTRL + A and then CTRL + G in layers and works) but I need in the script

    Please could someone help me?

    Thank you!

    I found the solution

    main() {} function

    If (app.documents.length == 0) {return ;}

    app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

    var doc = app.activeDocument;

    var mast = doc.layers.add ();

    Mast.Name = "original";

    var group = mast.groupItems.add ();

    var pageIt = mast.pageItems.add ();

    While (doc.layers.length > 1)

    {

    While (doc.layers [doc.layers.length - 1].pageItems.length)

    doc. Layers [doc.layers.Length - 1] .pageItems [doc.layers [doc.layers.length - 1].pageItems.length - 1] .move (grup, ElementPlacement.PLACEATBEGINNING);

    doc. Layers [doc.layers.Length - 1] .remove ();

    }

    }

  • Photoshop script to copy all the layers of close PSD to open the current document

    Hi, I have very limited capacity script so this task is above my pay grade

    I'm looking for a script to read and copy all the layers in a PSD saved file and copy them into the current active document. The two documents have the same size and I need to be able to change text layers after copying. Anyone has any advice or examples of how I might be able to do this?

    Thank you in advance for any help you can offer.

    Kind regards

    Marcus

    Try the script in entry below. You must open the destination file, and you must put in the path and name where your source file. It will not choose a layer from background from the source file.

    #target photoshop
    var sFile = new File('~/desktop/template.psd');//change path to template file
    var doc = activeDocument;
    var sDoc = open(sFile);
    
    var idselectAllLayers = stringIDToTypeID( "selectAllLayers" );
        var desc2 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref1 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref1.putEnumerated( idLyr, idOrdn, idTrgt );
        desc2.putReference( idnull, ref1 );
    executeAction( idselectAllLayers, desc2, DialogModes.NO );
    
    var idDplc = charIDToTypeID( "Dplc" );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref2 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref2.putEnumerated( idLyr, idOrdn, idTrgt );
        desc5.putReference( idnull, ref2 );
        var idT = charIDToTypeID( "T  " );
            var ref3 = new ActionReference();
            var idDcmn = charIDToTypeID( "Dcmn" );
            ref3.putName( idDcmn, doc.name );
        desc5.putReference( idT, ref3 );
        var idVrsn = charIDToTypeID( "Vrsn" );
        desc5.putInteger( idVrsn, 5 );
        var idIdnt = charIDToTypeID( "Idnt" );
            var list1 = new ActionList();
            list1.putInteger( 3 );
            list1.putInteger( 4 );
        desc5.putList( idIdnt, list1 );
    executeAction( idDplc, desc5, DialogModes.NO );
    
  • Y at - it a good script to collect all the layers in 1 layer?

    I am doing something similar to the selection of layers and using collection based on new layer in Illustrator. It runs successfully on several layers, but for others it will expel just ' mistake Illustrator: 1346458189 ("PARM").

    My script is really simple and I use it to collect layers into a layer named "Earned", if it has more than 2 layers. I even tried the fix suggested in this Readme: http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/pdf/illustrator/scripting/Readme.tx t. But I get an error just when you reference a running level. I tried directly referring to the current in the loop layer, but it always causes problems. If I get rid of the line of movement (which is the whole reason for this script), it works fine. I tried to let the script sleep and a few other things, but cannot make it work properly. I've included some debugging lines who write in the console to make sure that everything is properly defined

    var = app.activeDocument actDoc

    var layerCount = actDoc.layers.length;

    $.write("\n//layer Name\nLayer Count:" + layerCount + "\n///").

    var placeInLayer = actDoc.layers ['Collected ""];

    If (layerCount > 0) {}

    for (i = 0; i < layerCount; i ++) {}

    try {var topLayers = actDoc.layers [i] ;}

    catch("|)    "+e) {

    $.write (e)

    }

    .write $("\nLayer name:"+ topLayers.name+"|)    Count: "+ i +" ")".

    Sublayers = topLayers.layers;

    If (topLayers.name == "Collected") continue;

    topLayers.move (placeInLayer, ElementPlacement.PLACEATEND);

    }

    }

    Try a loop back... from the bottom layer.

  • Groups of layers PShop CC Panel - drag all the layers in the Group at a time?

    In Photoshop CS5, when I have several layers in a group, I can move (click-and - drag) all layers at once in the group by the presence of the Group layer selected. Now that I work in a place that uses CC, I noticed that I can't do that in CC. Even though I have the 'Group' selected layer, I can only drag a layer that resides within this group and not the whole group. Is there a setting in CC that control the behavior of the functioning of the Group selections? Thank you-

    You have checked or unchecked auto-sélectionnez it the option in the options bar?

    Maybe it's because her you have unchecked the option which moves only one layer and all group works even after you select the group.

  • can someone help me? I need a script for Photoshop cs code 6, reflecting all the layers in a group, each individual layer, please!

    I need a script code that reflect each layer in a prayer group!

    Currently the command use the pivot point for the transformation on the right side of the Center, you can change this line:

    bcm_mirrorAllCH (getSelectedLayersIdx (), "CR", "Horizontal");

    with this:

    bcm_mirrorAllCH (getSelectedLayersIdx (), "CC", "Horizontal");

  • How to get through all the layers?

    I would like to write a script to rename all the layers, but I don't know how to do, who can help me?

    function traverse( layerSet, callback )
    {
      for ( var i = 0; i < layerSet.layers.length; i++ ) {
           var l = layerSet.layers[ i ];
           app.activeDocument.activeLayer = l;
           if ( l.typename == "LayerSet" )
           {
                traverse( l, callback );
           }
           callback( l );
      }
    }
    
    function toUpp( l )
    {
        l.name = l.name.toUpperCase();
    }
    
    traverse( app.activeDocument, toUpp );
    

    In this case, the callback is defining the name of the layer in upper case. The app.activeDocument is a layerSet too. For some reason you need to select a layer before running this script.

  • script to unlock all layers in the illustrator file

    Hello!

    I run a batch place script the name of the document in the image and then save the document, all documents in a foder.

    However, he refuses to put this text, that the target layer is blocked at the outset.

    I'm looking for, so a piece of script that I can add to this script that will be first to unlock all layers in the document.

    Can someone help me with this?

    Something like this unlocks all the layers:

    myDoc = app.activeDocument;

    myLayers = myDoc.layers;

    for (a = 0;

    myLayer = myLayers [a];

    myLayer.locked = false;

    }

    But it is not unlock all items on layers.

    HTH,

    Ariel

  • Charge multiple batteries selected into individual layers for each stack files

    HI -.

    Does anyone know if there is a way to charge the batteries of multiple images at once, with each pile loading in PS CC as sets of pictures in individual layers? I searched this site and others without success.

    My intention is to save time to open 150 + images and then stacking them manually to make the HDR work on each game. I tried to charge the batteries to help to load files from Photoshop layers, but it piles up all the batteries into a single image with all the stacks of layers under. With a script running properly, I would like to be able to open, for example 3 images - each with 3 exposures. And then have photoshop create 3 images, each with their 3 exhibitions. I could then starts with the HDR work by hand for each game.

    Any idea is appreciated!

    Thank you
    Matt

    Sorry I was away. Created documents will always have the Untitled in the name of the file as they are created with the "load of files in Stack.jsx" and this cannot be changed without saving the document.

    If I misunderstood it please let me know.

  • Scripting inDesign: Loop through the layers

    I'm doing a script that will:

    To loop through all the layers in a document.

    Add the layers unlocked in table

    Loop in this table and glue them in place on each layer.

    I don't know how to loop through all the layers.

    Here is my script (I used? to represent where would the loop through all the part of layers):

    JavaScript document

    Set up a table to keep unlocked layers

    var layercollection = [];

    Browse layers and unlocked the layercollection table

    for (i = 0;? i ++) {}

    app.activeDocument.activeLayer = app.activeDocument.layers.itemByName (?);

    If (app.documents [0] .layers.) ([i]). Locked) == false;

    layercollection.push (Layers.itemByName ([i]))

    }

    Loop in table layercollection and paste in place

    for (i = 0; i < layercollection.length; i ++) {}

    app.activeDocument.activeLayer = app.activeDocument.layers.itemByName (tl [i]);

    app.pasteInPlace (); Dough

    }

    Can someone help me complete my script.

    Thank you!

    Did you test them all your solutions in a real world scenario?

    Theoretically, it should work this way (if one ignores that a layer is invisible, too), but even without the problem of invisible layers app.pasteInPlace () prefer to paste into the original layer, if the option "Paste remembers Layers" is checked.

    So I recommend you do the following:

    var oldPasteRem = app.clipboardPreferences.pasteRemembersLayers;
    //uncheck "Paste Remembers Layers"
    app.clipboardPreferences.pasteRemembersLayers = false;
    
    for (i = 0; i < app.activeDocument.layers.length; i++) {
    
        //Maybe the user does not want objects pasted to invisible layers:
        if(app.activeDocument.layers[i].visible == true && app.activeDocument.layers[i].locked == false) {
            app.activeDocument.activeLayer = app.activeDocument.layers[i];
            app.pasteInPlace();
        };
    };
    //Restore the old condition:
    app.clipboardPreferences.pasteRemembersLayers = oldPasteRem;
    

    Uwe

  • TIFF of Import Options - flatten the layers into a single Image

    Hi all

    Running a script to open the files and convert them into another type. When it comes to a TIFF file type, called 'TIFF Import Options' dialog box opens. This window has a column of Options containing two pieces of music radio to "Convert layers to objects" and "flatten into a single Image. How to open the file with the whole "flatten the layers into a single image?

    Thank you

    OpenOptionsPhotoshop.preserveLayers = true;

  • Rasterize all text layers?

    Hello

    Can someone tell me please in the right direction in regards to a loop in an open psd file and Pixelation all text layers (no other layers).

    I'm not one of those people who expect scripts written for them, just so that a point in the right direction would be sufficient (except if you're feeling generous).

    I'm new to Photoshop scripts and still get my head around some syntax.

    Thank you in advance.

    -What is it?

    if (!documents.length) { alert('There are no documents open.', 'No Document');}
    else {processArtLayers(activeDocument);}
    
    function processArtLayers(obj) {
        for( var i = obj.artLayers.length-1; 0 <= i; i--) { if (obj.artLayers[i].kind==LayerKind.TEXT){  obj.artLayers[i].rasterize(RasterizeType.TEXTCONTENTS); } }
        for( var i = obj.layerSets.length-1; 0 <= i; i--) {processArtLayers(obj.layerSets[i]); } // Process Layer Set Layers
    }
    
  • Add a mask on all selected layers.

    Hello guys! I'm here looking for a script that adds the mask on all selected layers.

    Pictures.png

    Sorry, I found that I had made a change of course, it should work now.

    #target photoshop;
    app.bringToFront();
    
    if(documents.length) main();
    function main(){
    var selectedlayers = getSelectedLayersIdx();
    selectedlayers.reverse();
    for(var z in selectedlayers){
        selectLayerByIndex(selectedlayers[z]);
        selectLayerData();
         createMask();
        }
    app.activeDocument.selection.deselect();
    for(var a in selectedlayers) {selectLayerByIndex(selectedlayers[a],true);}
    };
    function getSelectedLayersIdx(){
          var selectedLayers = new Array;
          var ref = new ActionReference();
          ref.putProperty(charIDToTypeID('Prpr'), stringIDToTypeID('targetLayers'));
          ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
          var desc = executeActionGet(ref);
          if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
             desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
              var c = desc.count;
              var selectedLayers = new Array();
              for(var i=0;i		   
  • Export all the layers in png in Photoshop, including those outside the canvas area

    I use the script, but if some of my layers are outside the canvas, it removes those the only visible part.

    But we need everything in the layer in png, so is visible in the Web or it is outside.

    Best,

    Gunjan

    Use activeDocument.revealAll (); then export all your layers.

  • Script Help: The names of layers from the Excel data

    Hello!

    I'm a noob script and have tried to learn, but unfortunately I just haven't the time. Projects at work keep me in the Bay. In any case, here's my scenario and I hope someone can guide me.

    I want a script that would look at a database (XML, CSV, excel or anything that works) and create separate layers in illustrator based on the data.

    Example: description and part number comes from a database. Name of the Illustrator layer is what I want the automation script. The reason for this request is a 200 point that I don't want to retype.

    Part numberDescriptionName of the Illustrator layer
    33456Point 133456_Item 1
    33457Point 233457_Item 2
    33458Point 333458_Item 3
    33459Point 433459_Item 4
    33460Point 533460_Item 5
    33461Item 633461_Item 6
    33462Point 733462_Item 7
    33463Item 833463_Item 8

    After that, I have all my items, with correct layer names, I export each layer as a separate PDF file. The name of the export file would be identical to the layer name with "_1up" appended to the end. For example, 33456_Item 1_1up.ai.

    I would have a separate illustrator file that contains all the same name of the layer as above and then I place the exported file, he respected the layer. This is where the script of another would be great. Is it possible to make a script that will place an image on a layer that has similar naming structures (the only differences would be the name of the layer would not "_1up")?

    I hope this makes sense and I know that I ask a lot. I thank very you much in advance!

    still not sure why export you all the layers to separate the files only to place them all back again?

    but this will get your layers created.

    var line,lay,myLayers = [];
    var csvFile = File('e:/csv.csv');
    csvFile.open( 'r' );
    while(!csvFile.eof){
        line = csvFile.readln();
        line = line.replace(',','_');
        myLayers.push(line);
    }
    csvFile.close();
    var doc = app.activeDocument;
    for(var i = myLayers.length - 1; i > 0; i--){
        lay = doc.layers.add();
        lay.name = myLayers[i];
    }
    var oldLayer = doc.layers.getByName('Layer 1');
    oldLayer.remove();
    

    CSV should simply be:

    33456, point 1

    33457, point 2

    ...

Maybe you are looking for