• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Pasting into multiple layers

New Here ,
Nov 13, 2019 Nov 13, 2019

Copy link to clipboard

Copied

Hi

Does anyone know if its possible to paste the same thing into multiple layers with one click in Illustrator? I'm aware of the 'paste on all artboards' option, however thats not an option for me. I'm working in layers of more than 100 + and at the moment the only way of duplicating the same thing onto all layers is to tediously copy and paste in front on every layer, any solutions would be much appreciated.

 

thanks

nick

Views

4.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 13, 2019 Nov 13, 2019

Hi nick, try this script. Select the text in the top-most layer, the script will copy it to all other layers except the first one.

 

 

// copy selected object to all layers
// carlos canto
// https://community.adobe.com/t5/Illustrator/Pasting-into-multiple-layers/td-p/10735655

var idoc = app.activeDocument;
var sel = idoc.selection[0];

for (var a=1; a<idoc.layers.length; a++) {
    sel.duplicate(idoc.layers[a], ElementPlacement.PLACEATBEGINNING);
}

 

Votes

Translate

Translate
Adobe
Community Beginner ,
Dec 01, 2023 Dec 01, 2023

Copy link to clipboard

Copied

To clarify, what I really want to be able to do is paste (into place or paste in front) from clipboard. I have different elements on each 25 layers that has to remain. I just want to paste into (and on top of) the existing content of 25 layers at a time.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 01, 2023 Dec 01, 2023

Copy link to clipboard

Copied

Hi Stan, to make it work with any number of layers instead of a fixed 25, this version will duplicate one or more selected objects into any number of UNLOCKED layers. So, lock the layers you don't want to duplicate the selection. Does that work for you?

 

there's no need to copy, just select the objects you want to duplicate

//  copySelectionToAllLayers_v3.jsx;   // carlos canto // 07/06/13
//  http://forums.adobe.com/message/5481849?tstart=0#5481849
// https://community.adobe.com/t5/illustrator-discussions/pasting-into-multiple-layers/td-p/10735655

//#target Illustrator

// select one or more objects, selection will be copied to all unlocked layers
// lock layers to prevent selection to be copied
var idoc = app.activeDocument;
sel = [];
if (selection.length>0) {
    
    for (var c=0; c<selection.length; c++) 
        sel.unshift (selection[c]);
        
    selection = null;
	
	var layers = idoc.layers;
    var layercount = layers.length;
	for (b=0; b<sel.length; b++) {
        var obj = sel[b];
        for(a=0; a<layercount; a++) {
            var ilayer = layers[a];
            if (ilayer.locked == false && obj.layer != ilayer)
                obj.duplicate(ilayer, ElementPlacement.PLACEATBEGINNING)
        }
        //obj.remove();
	} 
}
else {
	alert("select something before running");
}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 03, 2023 Dec 03, 2023

Copy link to clipboard

Copied

LATEST

Hi Carlos,

 

Yes - worked like a charm. Thank you very much! This will save the tendons in my wrist!

 

Much appreciated,

Stan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 19, 2022 May 19, 2022

Copy link to clipboard

Copied

Dear Carlos,

May I know how I can use your scripts in the following layer's structure?

In my case, I want to copy <Rectangle> and paste in (Layer 4,3,2,1).

I think I must modify the script, but I don't know which part I have to modify. Could you please help me? Thanks a million. 

pyaes16143374_0-1652949557759.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

Hello @pyaes16143374 , do you still need this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

Dear @CarlosCanto, Thank you. No need, my friend helped with that one.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

I believe this script would help meso much! I have taken the script and saved as plain text but i am not able to get this to work. I saved the name with .jsx as well. Is there a place I can pay someone to put this together for me and I can just download it? Any help would be appreciated! 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

Here you go, remove .txt extension after downloading

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 06, 2021 Sep 06, 2021

Copy link to clipboard

Copied

Hi, should the script work in CS5?

 

tnx

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 06, 2021 Sep 06, 2021

Copy link to clipboard

Copied

Hi, yes.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 12, 2023 Feb 12, 2023

Copy link to clipboard

Copied

Hi Nick,

 

Yep it's possible. All you have to do is highlight all the layer in your layers window then PASTE IN PLACE. That should paste the object or text into all layers. I find it's a good idea to first paste on top layer get it in the right place then paste in place onto the rest. Hope that helps!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 12, 2023 Feb 12, 2023

Copy link to clipboard

Copied

Sorry - scratch that. I thought it worked but was just a delayed fail as the layers were slow to load. (face palm)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines