질문
Moving layers and folders out of a folder to the root via script
I want to take a load of layers and layersets out of a folder so they're no longer nested. I'm using this
// Move art layers out of the STACK folder
for (var i = duplicatedStackFolder.artLayers.length - 1; i >= 0; i--) {
duplicatedStackFolder.artLayers[i].move(newStackDoc, ElementPlacement.PLACEATEND);
}
// Move layer sets (subfolders) out of the STACK folder in forward order
for (var j = 0; j < duplicatedStackFolder.layerSets.length; j++) {
duplicatedStackFolder.layerSets[0].move(newStackDoc, ElementPlacement.PLACEATEND);
}
My problem is some of the layersets get missed and not taken out of the folder.
If i use this instead then i get all the layersets but they end up in the wrong order.
// Move layer sets (subfolders) out of the STACK folder
for (var j = duplicatedStackFolder.layerSets.length - 1; j >= 0; j--) {
duplicatedStackFolder.layerSets[j].move(newStackDoc, ElementPlacement.PLACEATEND);
}I've tried using PLACEATSTART but that doesn't seem to work
how can i resolve this?
