Skip to main content
Participating Frequently
November 13, 2019
Answered

Pasting into multiple layers

  • November 13, 2019
  • 6 replies
  • 8662 views

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

Correct answer CarlosCanto

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

 

6 replies

Participant
February 13, 2023

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!

Participant
February 13, 2023

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

Participant
September 6, 2021

Hi, should the script work in CS5?

 

tnx

CarlosCanto
Community Expert
Community Expert
September 6, 2021

Hi, yes.

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
November 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);
}

 

Participating Frequently
November 14, 2019

hi Carlos

 

thanks for this although im having trouble installing it script editor is saying "A identifier can’t go after this identifier."?

Ton Frederiks
Community Expert
Community Expert
November 14, 2019

You don't need to install it with the script editor.

You can simply open the script using the File menu > Scripts > Other Script...

Or install it in the meru:

https://helpx.adobe.com/illustrator/using/automation-scripts.html

Legend
November 13, 2019

"1 have a 100 or so files to do with some that have upwards of 250 layers, being able to potentially click once and have it pasted in front of all layers will save me an incredible amount of time, plus this is not the only instance where i have to do further pasting into all layers later on, seems incredible that illustrator does not have this as an option to me...."

 

It sounds like only one layer at a time will be visable for each output instance. If that is the case, using Variable Data might just save you a ton of time.

rcraighead
Legend
November 13, 2019

Yes, or a script.

John Mensinger
Community Expert
Community Expert
November 13, 2019

What you want doesn't exist as a feature, presumably because having the same element(s), at the same coordinates, on 100+ layers is not an intended workflow. Having that content visible on one layer is all that's needed for it to appear on the artboard in a typical scenario. I realize there may be exceptions like cumulative animation sequences and such, but there are other ways to go about that rather than an after-the-fact paste. So specifically, why do you need that one thing on all layers?

Participating Frequently
November 13, 2019

each layer needs a different text annotation added in the same place using a basic framework, so as opposed to the very long way of individually writing full text on , i am copying and pasting on every layer a generic text and then editing a small portion of this on every layer, this then identifies each layer which i need to do before i can proceed any further. these artworks come to already in layers and there is no other option to have them presented another way. (its for screen printing btw)

 

John Mensinger
Community Expert
Community Expert
November 13, 2019

 

". . . pasting on every layer a generic text and then editing a small portion of this on every layer . . ."

 

Hmmm, so if you have to visit each layer one-by-one to make that edit anyway, why is it a problem to just tap Ctrl/Cmd+F to paste in front before making the edit? What am I missing?

Larry G. Schneider
Community Expert
Community Expert
November 13, 2019

Check in the flyout menu of the Layers panel (upper right) and make sure that Paste Remembers Layers is checked.

Participating Frequently
November 13, 2019

thanks for reply, i have looked at that option and that just allows you to copy and paste from one file to the next keeping it as layers rather than flattening it, however it doesnt allow you to paste into multiple layers at a time, even with that checked and all layers selected i can only paste into 1 layer still?