Copy selected and paste to another layer
Hello all,
First off, I'm new to this and I've gone through tons of posts concerning this, but to no avail.
Here is what I'm trying to achieve:
- Create 3 new layers
- Copy selected artwork from an existing layer, and paste it in the three new layers
- Paste should be in place
That is the core of my script. I can create the three layers. I can paste what is selected. My issue is I can't paste into the new layers, and paste places the selected items in the center of the page. I don't want to duplicate the layer because there are things on the layer I don't want copied to the other 3 layers.
Another Issue I'd like to resolve is placing the 3 new layers above a layer called Original.
I haven't dug into this either, but how would I go about selecting all the pasted items in the 3 new layers as the last thing the script does?
Illustrator CC 2017 / PC
Thanks all.
//My added Layers;
sourceDoc = activeDocument;app.copy();
targetLayer = sourceDoc.layers.add();
targetLayer.name = "Layer1";redraw();
app.paste();
targetLayer = sourceDoc.layers.add();
targetLayer.name = "Layer2";
redraw();
app.paste();
targetLayer = sourceDoc.layers.add();
targetLayer.name = "Layer3";
redraw();
app.paste();
