Answered
Automatisatin of duplication layers
Hello,
How I can duplicate the layer by script ?
I have Layer X and how to make a copy of that ?
Hello,
How I can duplicate the layer by script ?
I have Layer X and how to make a copy of that ?
Like I wrote in your last thread, a layer doesn't have a duplicate method.
You have to go "the long way":
Create a new layer and duplicate all items from original layer to the new one.
// layers have no duplicate method - that's why
// regards pixxxelschubser
var aDoc = app.activeDocument;
var dupLay = aDoc.layers.add();
dupLay.name = "Duplicat";
redraw();
var aLay = aDoc.layers.getByName("X"); // your existing layer name
var pI = aLay.pageItems;
for (k=pI.length-1; k>=0;k--) {
pI[k].duplicate(dupLay, ElementPlacement.PLACEATBEGINNING);
}
If that works for you
have fun
😉
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.