Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: Move a layer/layerset into a layerset using ID only

$
0
0

It is simpler using this?

 

var thisLayer = activeDocument.activeLayer;

// create new layerset if doesn't exist

if (activeDocument.layerSets.length == 0) activeDocument.layerSets.add();

// return to previous selected layer

activeDocument.activeLayer = thisLayer;

// move layer to the referenced layerSets[0] but the id of this element could be any number

activeDocument.activeLayer.move (activeDocument.layerSets[0], ElementPlacement.PLACEATEND);

 

So the solution is to create first a script for(var a in activeDocument.layerSets) to reference your chosen layerSet by id and if exists it gives you the index.


Viewing all articles
Browse latest Browse all 27456

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>