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
1 Correct answer
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);
}
Explore related tutorials & articles
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.
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");
}
Copy link to clipboard
Copied
Hi Carlos,
Yes - worked like a charm. Thank you very much! This will save the tendons in my wrist!
Much appreciated,
Stan
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.
Copy link to clipboard
Copied
Hello @pyaes16143374 , do you still need this?
Copy link to clipboard
Copied
Dear @CarlosCanto, Thank you. No need, my friend helped with that one.
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!
Copy link to clipboard
Copied
Here you go, remove .txt extension after downloading
Copy link to clipboard
Copied
Hi, should the script work in CS5?
tnx
Copy link to clipboard
Copied
Hi, yes.
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!
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)


-
- 1
- 2