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 ();

}

}

Tags: Illustrator

Similar Questions

  • 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;

  • I use Illustrator CC and sent a file to a colleague who uses CS6 where all the layers become a great layer.  How can I send it and preserve the layers?

    I use Illustrator CC and sent a file to a colleague who uses CS6 where all the layers become a great layer.  How can I send it and preserve the layers?

    coledang,

    Save a copy, and in the following options choose CS6.

    In this way, it should open correctly in CS6, and the original document is unscathed.

    You may find that some (new CC) features will not survive the downsaving.

    Edit: Hi SRiegel.

  • How to reverse a PSD file that combined layers into a single layer...

    Hello

    I'm not sure what happened, but I got a PSD file, I was working with multiple layers and then I saved a PDF file of the file and I think I may accidentally active files somehow because now my PSD file layers are combined in a background. How to cancel it (somehow liberate all the layers in the file again)? I need to send the PSD file with all its layers available for editing, and I have no idea how to solve this problem.

    Any help is greatly appreciated. Thank you very much!

    ashmic19

    Unless you have a copy backup of the PSD layered, you can't. Once flattened and saved, you can never restore flattened layers, they are gone. Sorry... better is to save several copies so in this case in the future you don't suffer that again.

  • Avoid to group all the objects in different layers into a single layer

    When I group objects to different layers, they all end up in single layer... I have a slight memory of what it is possible to the group object without affecting the layers... maybe a setting?

    Vincent,

    Crossposting: I was the addition of the procedure (which I posted accidentally before finishing).

    Here's the Bill:

    But you can create a selection across layers as follows, using the drop down selection:

    Select objects, then > Save selection, selection of a name;

    After that, the choice is displayed at the bottom of the drop-down list selection, available for selection (sorry)

  • Group and ungroup without all the data to a single layer?

    Hello!  When I combine several functions (usually for purposes of alignment), separating them and then throw all the objects on a layer.  It's pretty frustrating; Anyone know a work around?

    You need to revise your workflow. When you group things they belong on the layer of the object higher in the Group and when you release that's where they stay. You could try to save a selection instead of a group for purposes of alignment by watching. A selection can have objects on multiple layers.

  • Is there a way to center align multiple layers into a single layer?

    I mean, that's what you have layers I and I which are placed side by side, so they look like "II". You want to Center compared to some selected location so that they look like still 'II' and not 'I '.

    You see what I'm saying?

    Is there a way to center them so that they are always in the same configuration compared to the other instead of centering them so that they all get two layered in the centering? Perhaps by linking their or another way?

    Have you tried grouping them and then centering group?

  • Method to select all the layers 'invisible '?

    Hello

    Does anyone know if there is a plugin or a way to select all the invisible layers in a photoshop file automatically with a single click?
    It would be really handy when it comes to huge photoshop with lots of files files and layers...

    Screen shot 2012-11-12 at 15.22.36.png

    Kind regards

    Ben

    Not sure on the hiden targeting all the layers in a single click, but you can filter so that no visible layers only show, then it is easy to target all.  (On the tab of the layer panel, choose attribute, then no Visible)

    Might be possible to write a script or an action recording to do the same thing?

  • Can I move all the objects again selected layer without clicking hundreds of layer bars?

    I'm working on a complex illustrator file generated by GIS software. He gave me all kinds of groups of clip & road clip - what I really need, it's just to put all the same coloured polygons on the layer of a high level (unfortunately I can't draw all of my polygons in a group because illustrator doesn't pull these objects out of their existing clipping groups, and the card gets screwed completely upward if I release the clipping masks. With simple cards I have no problem Direct by selecting all of the polygons, I want, selecting their layers in the layers panel, then moving them to a new layer. This card is too complex, because there are hundreds of objects and hundreds of corresponding layers (they are not contiguous, or else I could simply click can be done with it).


    I used select > same > fill type to select all the polygons, I want that on a single layer, but I really hope that I don't have to select all the layers for each item one by one before I can move them to a new higher level layer. Does anyone know if there is a way to moving all the objects in a new layer selected without having to actually click all the layers in the Panel? Completely open to the alternative routes to my desired result!


    Thank you very much.

    Of course, after making the selection drag selection (to the right of the layer) icon on the desired layer. This will move any selected layer to the new layer.

  • Accidentally moved all the pictures into folders separated in single folder!

    So somehow I managed to pass all my photo of my work out of their respective files, well organized files in a single folder. I can't figure out how. All 15 588 of them... now unorganized in one folder. 'Undo' didn't work and I tried to restore from a backup of the catalog without success. Also... my backup Time Machine refuses to restore because the drive is messed up, so it's useless. Lightroom has still all recognized records in the catalog, but the pictures are missing, (?) and not just "d - link" them and point Lightroom for photos in the new folder.

    So guess my question is, can I I go to each folder in lightroom and physically move all the photos that were previously in this NEW folder in this folder on the system automatically? It seems that lightroom recognizes the folders used to exist here... just can't find them. Well, I know that they are all in a folder and would like Lightroom to move them all back into their appropriate folders. In this way, when I search a folder on my computer (not in lightroom), the folder that contains the photos that used to be there. I hope this makes sense. I use Lightroom 4.1 on a Mac OSX version 10.8.3. Thanks for any help.

    My apologies in advance: I did not read all of the background messages.

    If I understand correctly:

    * Folder structure in Lightroom is intact (but the folders/files are considered to be 'missing').

    * Folder on the disc structure has been flattened (all files are now in a single folder, instead of a tree).

    If that's true, this plugin will solve your problem:

    RelocationServices

    (he has a test mode to see exactly what it will do before you commit to actually do).

    Rob

  • How to consolidate the existing layers into a new layer at the top of the stack?

    If I have several layers that contribute to the current view of an image, how can I create a new layer at the top of the stack, which brings together all the layers that contribute to the view without destroying the existing layers? Thank you.

    Shift + Ctrl + Alt + E or Shift + Cmd + Option + E (mac)

    Merge Visible (stamp visible) in a new layer at the top of the layers stack so the top most layer is active (targeted) and visible

    Post edited by: R_Kelly

  • Move all the objects in the model without destroying keyframe positions?

    I built an animation based on a number of position keyframes.  I want to take the entire animation and just back up a bit on the screen so that it is centered better.  However, I don't know how to do this without manually set each keyframe for the move.

    I wish I could nest the whole comp within a clip and then change the position of this element.  Is there a way to do this in AE?

    3 ideas come to mind:

    1. Add a null value and parent all layers to null (if the layers have relatives, and then just parents parents of course). You can delete the null value later and change your keyframes for the new offset.

    2 pre compose all the layers and then move it as a single layer.

    3. If it's a 3D scene, then you can simply move the camera since it controls all the layers.

  • Move all items from carton to a layer in InDesign (AS)

    Just learning how to move all the guides to a layer, now I would like to just the products box to a layer. My goal is to separate the elements of page elements pastnoard on separate layers. Favorite AppleScript.

    It seems like it should be very simple, but I can't work as a (ID CS5, Mac OS x 10.6.8).

    If I select a point on the editing table and ask its parent, the result page is 'nothing. ' But asking you for each page element whose parent page has nothing (or 'nothing' or 'no' or 'nada' or "") returns no result.

    Can I ask for each item in the page which the parent page ID is the identification number of my single page, and you will find the item on this page (except the items in cardboard), but if I ask for each page element whose ID is NOT the ID of my page, it does not find the two points that I put on the editing table.

    Substances, can you get it actually works in JS?

    The only thing I've found so far and who works at all in AppleScript is a solution very kludgy:

    Tell application "Adobe InDesign CS5"

    Tell document 1

    each element of the page including the id of the parent page is greater than 1 the value myPageItems

    the value myEveryItem for each page element

    Repeat with myItem in myEveryItem

    If is not then myItem in myPageItems

    myItem move to the layer "layer of cardboard.

    end if

    end repeat

    tell the end

    tell the end

    That could take some time to run on a document with a lot of page elements. It is good to be a better way...!

  • Is it possible to copy all the layers in the layers panel and paste them in a new document?

    The content of each layer will be different on each document so I don't want to copy. I have 12 documents to be used in a calendar and I want all the layers as well as their names and colors to be the same in each document. I already have all the pages designed and built, but personal information is to be added, and I want each of them to match all the others.

    Basically, all I want to do is to copy the contents of the layers panel and past in each of the other documents.

    I just create a page at the end of the document w / layers and on this page, add an item by layer. Also, if you have 15 layers, drag the small fifteen frames on the page and the layer icon to assign each image to another layer.

    Then in the Pages panel menu, choose move Pages. Choose this 'page of layers' to move to your receiving document (another of your calendar documents), Destination: end of the Document.

    The receiving document will get all the layers. Remove all items (15 views) on the extra page and the layers remain.

    Next time you make a schedule, you should check the add-on for InDesign Calendar Wizard. You will cry all the time you wasted it making manually ;-(

    Home Calendar Wizard

    Anne-Marie

    InDesignSecrets.com

  • 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 );
    

Maybe you are looking for

  • want to dv6-7222nr: the password reset envy dv6-722nr

    need help. Anyone know how to reset the bios pass. After 3 attempts error code: 70093499

  • SECUREit is still available?

    Hello. I got Lenovo A6010, I hate the installed security because it is just 'clean' or released some data. (?) I just want to ask if SECUREit is still available, because I was looking for she playstore but I have not achieved anything. I love this ap

  • Windows Live Photo Gallery 'Read only' error.

    After the Windows Live Essentials 2011 Installation, I lost all capacity for photo editing. If I try to edit a photo that is on my PC in my pictures folder. New 2011 Photo Gallery indicates that the file is a "read only file and Windows Live Photo Ga

  • D Link DWA 140 Wireless Stick does not work with Windows 7 Pro x 64

    After searching the Internet for most of the day, I am naïve. Installed Win 7 Pro x 64 (from MSDN-AA) today and I wanted to use my job well DWA 140 to connect to my router for internet. The Board in use is the Asus P5p77-M. All, who tried with 2 diff

  • Application of hierarchy Oracle EBS

    y at - it an easy way to create through SQL for R12 of EBS a hierarchy of all the forms and menus attached to responsibility. The MOS notes 1334930.1 'sensitive administrative pages in Oracle EBS' can list the users who have access to forms called, b