Copy link to clipboard
Copied
Hi Saranraj,
Try this..
var docRef=app.activeDocument;
var LsetGarmants=docRef.layerSets.getByName("Garments");
var LsetART=docRef.layerSets.getByName("ART");
var len=LsetGarmants.layers.length;
if(len>0){
for(var i=0; i<len;i++){
if(LsetGarmants.layers.typename=="LayerSet") continue;
flg=LsetART.layerSets.add();
flg.name=LsetGarmants.layers.name;
}
}
-yajiv
Copy link to clipboard
Copied
Hi Saranraj,
Try this..
var docRef=app.activeDocument;
var LsetGarmants=docRef.layerSets.getByName("Garments");
var LsetART=docRef.layerSets.getByName("ART");
var len=LsetGarmants.layers.length;
if(len>0){
for(var i=0; i<len;i++){
if(LsetGarmants.layers.typename=="LayerSet") continue;
flg=LsetART.layerSets.add();
flg.name=LsetGarmants.layers.name;
}
}
-yajiv
Copy link to clipboard
Copied
thank you very much it's working
layers
Group
the group folder align change
it's possible the same align layer
Copy link to clipboard
Copied
Hi Saranraj,
Try this one. If its working please mark as correct answer.
var docRef=app.activeDocument;
var LsetGarmants=docRef.layerSets.getByName("Garments");
var LsetART=docRef.layerSets.getByName("ART");
var len=LsetGarmants.layers.length;
if(len>0){
for(var i=len-1; i>0;i--){
if(LsetGarmants.layers.typename=="LayerSet") continue;
flg=LsetART.layerSets.add();
flg.name=LsetGarmants.layers.name;
}
}
- yajiv
Copy link to clipboard
Copied
this coding Run one folder is missing
Copy link to clipboard
Copied
natrevs code is close
With a few changes
var docRef=app.activeDocument;
var LsetGarmants=docRef.layerSets.getByName("Garments");
var len=LsetGarmants.layers.length;
var LsetART=docRef.layerSets.getByName("Art");
if (len>0 && LsetART.layers.length == 0) {
for (var i=len-1; i>=0; i--) {
if (LsetGarmants.layers.kind != LayerKind.NORMAL) {continue};
flg=LsetART.layerSets.add();
flg.name=LsetGarmants.layers.name;
}
} else { alert ("wrong structure"); }
Have fun