Duplicate the layer

I have been writing scripts in Photoshop and you need to convert my script to Illustrator.

I use the VBScript/Javascript program and also in .net with VB and c# to create programs for Photoshop / Illustrator

In Photoshop, you have layer.duplicate to duplicate a layer with all of its contents, but I can't seem to find the correspondent for Illustrator.

In the window of the layers in Illustrator, you can select a layer and then in the dropdown in the layer window, select duplicate 'NomCouche' I looked at the script reference and can't seem to find a solution.

Thanks in advance.

Sorry, the example you have a layer of higher level called "Layer 1" present in the document is waiting for you try to re-enter all the pageItems. "." As is, it does NOT the nested layers under what you need to address recursively through those if necessary.

Tags: Illustrator

Similar Questions

  • Duplicate the layer just above the layer source by script

    Hello

    I'm trying to duplicate the layer by using script. Layer duplicated only taking place at the beginning of the order of the layers. I want the duplicate layer just above the layer.

    I got this forum.

    var docRef = app.activeDocument;  
    with(docRef) {  
             var ll = docRef.activeLayer ; 
             var ln=ll.name;
             var ol = layers.getByName(ln);  
                   ll.visible = false;  
            var nl = layers.add();  
             nl.name = 'Duplicated Layer';  
             for (var a = ol.pageItems.length-1; a >= 0; a--) {  
                  ol.pageItems[a].duplicate(nl, ElementPlacement.PLACEBEFORE);  
                  nl.visible = true;
             }  
        }  
    
    //~ ElementPlacement.PLACEBEFORE); // moves it above a group named 'my group' in the stacking order  
    //~ ElementPlacement.PLACEAFTER); // moves it below a group named 'my group' in the stacking order  
    //~ ElementPlacement.INSIDE); // moves it inside a group named 'my group', at the top of the stacking order  
    //~ ElementPlacement.PLACEATBEGINNING); // moves it inside a group named 'my group', at the top of the stacking order just like ElementPlacement.INSIDE  
    //~ ElementPlacement.PLACEATEND);
    

    Screen Shot 2016-06-28 at 11.20.59 AM.png

    I duplicated the layer 2 and place it at the top. Strange.

    Help, please

    Kind regards

    Kitty

    Try this code...

    var docRef = app.activeDocument;
    with(docRef) {
        var ll = docRef.activeLayer ;
        var n=docRef.layers.length;
        x=ll.zOrderPosition;
        var ln=ll.name;
        var ol = layers.getByName(ln);
        ll.visible = false;
        var nl = layers.add();
        nl.name = 'Duplicated Layer';
        for (var a = ol.pageItems.length-1; a >= 0; a--) {
            ol.pageItems[a].duplicate(nl, ElementPlacement.PLACEATBEGINNING);
            nl.visible = true;
        }
        docRef.layers.getByName("Duplicated Layer").move(docRef.layers[n-x], ElementPlacement.PLACEAFTER);
    }
    

    -yajiv

  • How to duplicate the layer and rename it?

    Greetings to all.

    I do a little tool, and I need to duplicate the layer, change of name and so...

    Tell me how to change the name of the layer? After all, when duplicate layer app.activeDocument () of the range slider layer remains on the same layer. Can be done through hard brace, but I think that there is a simpler solution.

    Thank you

    Layers have a name property that can be changed via the Script.

    2014, use it at your own risk.

    #target photoshop

    If (app.documents.length > 0) {}

    theDoc var = app.activeDocument;

    var theLayer = theDoc.activeLayer.duplicate (theDoc.activeLayer, ElementPlacement.PLACEBEFORE);

    theLayer.name = "test";

    theDoc.activeLayer = theLayer

    };

  • Duplicate the layer to the different document with a new name for the layer.

    I'm trying to reproduce the function of 'Double layer' Photoshop where I can take a layer of an active document and duplicate to a target document, AND set the name of the new layer once it is copied.

    JavaScript is the language.

    CS4 Windows if it's important.

    All suggested code snippets?

    Thank you

    -Mike

    Sorry, I missed the doc 'target' in your question.

    app.activeDocument.activeLayer.duplicate (app.documents.getByName('ProofMaster.psd'));// dupe the layer
    app.activeDocument = app.documents.getByName('ProofMaster.psd');// switch to master doc
    app.activeDocument.activeLayer.name = 'Whatever';// the active layer is the one justed dupped so rename
    
  • Ctrl-alt for double layer now duplicates groups not only the layer?

    I almost always duplicate the objects or layers by using ctrl-alt drag (while using move tool) to duplicate the layer.  Now, in the last Photoshop CC 2014 it duplicates the not only the layer group.  Is this a setting?  Thank you

    Well, obviously, in the December Update they fixed it... It must have been a glitch in the previous update.  So if you have this problem - update to December was last updated.

    Thank you

  • How to duplicate a layer and then change the adjustment layer?

    This used to be easy to PS7, but he is evasive in CS4. Sometimes we need to duplicate a layer, then change the adjustment layer. For example, we may have selected a portion of an image and used the brightness contrast and then we need to create a new layer using the same section using selective correction. What we have done in the past, is to duplicate the layer, and then change the adjustment layer. Any ideas?

    Create your new adjustment layer. Option drag the mask layer on the new original setting, and then choose replace.

    Beware of the many similar masks:

    http://www.teddillard.com/2008/10/Geekzone-rosenholtz-Sanchez-effect.html

  • Selection of the layer not bound to cancel the story when the effect controls panel is open.

    Did anyone else noticed strange with the undo history behavior when the effect controls panel is opened?

    Try this:

    1. have the layers panel, the history and the visible effects at the same time.

    2. open an image

    3. duplicate the layer

    4 make a new empty layer

    5. take the Brush tool and paint two strokes on the new Virgin layer

    6 return the layer duplicated under the layer of white and two strokes of paint

    7. in the history panel, back in the States in history and look at the layers panel

    Untitled-2.jpg

    Now close the effect controls panel

    1. in the history panel, select the last State of history

    2 go back in the history States

    Noticed a difference?

    Photoshop elements 11 on a windows 8 bit x 64 system.

    Title of the message was edited by: Brett N

    I see the behavior, and I'll log a bug for her report. Very strange, but good catch what the effects Panel which is the source!

    27Prac, make sure that the effect controls panel is pointing upwards, it is essential. But I tested it on Windows and Mac and see on each.

  • When I try to duplicate a layer from one file to the other why appears a window of "displacement"?

    When I try to duplicate a layer from one file to the other why appears a window of "displacement"? What should I do?

    Never seemed this before.

    Thank you

    I can't reproduce this. The layer as you try to duplicate a smart object and there a displacement map? Looks like you might need to reset your preferences.

  • Why duplicate the background layer sometimes creates a layer named "Background copy" and other times "Layer 1"?

    I write an action that begins by copying the layer background twice, but action is hindering because he is looking for "Background copy" but the Ps has created "Layer 1"instead.

    It renames the copy of the background layer 1 layer if there is any other layers. It renames the version copy background if there are other layers.

  • Is there a way to rename the "object/text box" in the layer in the Panel?

    I have a provision that has several near areas of text twice in the workflow in a layer, each of them with a minor copy change. What shows in the list of "items" in the layer is the first line of each (default) text box and it happens that they all start with the same text in each. Therefore, in the Panel, I have a list of several items that all look the same and I cannot differentiate between them when I click on an individual that I have them turn on and off.

    I am aware that I can rename the name of the layer itself, but is it possible to rename items in the inside Panel of the layer? I'd love to rename some of them.

    If this isn't the case, I guess I would have to duplicate the entire layer several times, rename the layer itself, each of them almost identical except for editing text in small characters each. Looks like it would be a lot of waste of resources and space in the file.

    Thank you

    You should be able to re - appoint any object similarly - click to highlight the name.

  • the layer panel shortcuts

    Two things I do very often in the Panel layer is one of the two layers add to a group and duplicate a layer.
    I have not found all the shortcuts of teas using the keys.

    Y at - it all?

    / Mattias

    Yes, it is an action as well.

    Record the corresponding commands in the menu of the layers (duplicate and accumulate in the new layer) palette.

  • after effect to duplicate the issue of the composition: in the 2nd composition, change the first

    I downloaded free after effect models.

    after effect to duplicate the issue of the composition: in the 2nd composition, change the first

    This means that if I write "Ahmed" for the second, one automatically becomes even.

    I'm new in after effect. I have less idea of 'Master of composition and scene files.'

    How can I fix happening like that?

    simpler.jpg

    You should get some basic skills in After Effects.  It is not a program, you can just start using without having to learn the basics and expect to have success at all.

    That being said here, that's what you need to do.

    Comp 2 duplicate in the project (not the layer panel) Panel in order to have a '3 Comp '.  Add a layer to 1 Comp.  Now modify Comp3, and you will see the difference.

    Understand that Comp2 will always be Comp2 little matter how many times you duplicate in the layer panel.  Whenever you make a change to Comp2 that change will be seen in each layer named Comp2 any composition it is nested in. That's what you need to do.

    I just gave you a fish, but it won't last long.  Soon you will ask for another.  So now, I'll give you a fishing rod: you must learn how nesting compositions in After Effects.   You must take some time to learn the basics of After Effects, or else you're going to be here every day asking why this, why that. Every day ask for a fish.  You can simply download a model and expect to be able to use it.  It is an unrealistic expectation. .

  • Serious accidents with control of the expression spacing based on z-position of the layer

    I have massive crashes when you use this script expression below. I have just a text layer where I control the depandend letter-spacing of the current z position. From z = 0 to-500 (directly in front of the camera), the values are transformed by easyOut() from 0-10. So far, that's all.

    Now when I duplicate this line of text several times and start to change its position, then the accident happens. Text layers more I have the sooner the crash. This occurs when the edition therefore not made involved. In the preview is the applied standard rendering engine.

    Unfortunately, there is no specific error message - it indicates just that AFX no longer works and is now closed.

    My system features:

    I have 8 GB of RAM and 10 GB disk cache. That should be enough for a text flying around.

    I use the latest Version of CC of AFX 2015.1 13.6.1.6 running on Windows Ultrabook (Lenovo Yoga 1) 8.1. No CUDA detected so the preview is rendered by the CPU.

    Anyone has an idea why this happens? Help is very appreciated.

    max_spacing = 10;
    z_position = transform.position[2];
    var new_spacing = easeOut(z_position, -500, 0, max_spacing, 0);
    text.animator("Animator 1").property.trackingAmount = new_spacing;
    

    This is my test scene:

    http://Augenpulver-design.de/Exchange/tmp/AFX_Expression_Crash_Scene.zip

    You create a hole of logic by referencing the layer itself probably. Should not happen, then I would call it a bug. Probably to do with flaky matrix code also used to smack and a few other things. Try to use a Null value and parent the text to it. This would work much better.

    Mylenium

  • Is it possible to use scripts to duplicate a layer?

    I recently asked this question in the Illustrator forum that I did not know there was a separate script forum: find and replace text problem

    I finished just dangling down and solve my problem after spending a few hours just to experiment with script guide.

    Now, I'm finishing the final piece of the puzzle for this script which would be totally solved my problem. Is it possible to make the script duplicate a layer? There is a duplicate() function, but it seems not to apply to the layer element. Is there a work around?

    Thanks for your help

    Michael

    Regarding javascript:
    -CS5, you must name a new layer, called the same name as your source for baptism layer and then duplicate each element of the source for the new layer.

    Be aware that things such as graphical styles, layer, opacity masks on layers and sublayers don't get carried forward like that.

    However, with the CS6 + that allows a script to play an action, you can actually get "whole enchilada" by recording an action where you go into the menu drop down and use the "Duplicate" command This will save "layers > duplicate Selection" in action. Then, you can use javascript to target your desired layer and play this action. Your new layer will be a string of "copy" added automatically, so you can choose to delete or modify that.

  • How the layer is duplicated into several work plans?

    Hello

    I use Photoshop CC 2015.

    I'm working on a document with different arboards.

    And I need to duplicate a layer from one to all work plans.

    Is it possible to do?

    Thanks for your help!

    Unfortunately there is no other way for the exception manually.

Maybe you are looking for