1 Reply Latest reply on Jul 2, 2014 10:59 PM by c.pfaffenbichler

    Script that create Layerset with name from layer?



      This should be easy for someone who know whet is doing so not me:P


      I want script to automatically create layerset from each selected layer, name it as that layer and place that layer in it


      I found old script that do that but only normal layer not linked or embeded, and I want to do it for all selected layers not only to one

      Can someone modify it a little to work little better? I have no idea how to do it and probably would take me like thousands hours or more




      #target photoshop


      function main(){

      if(!documents.length) return;

      var doc = activeDocument;

      if(doc.activeLayer.kind != LayerKind.NORMAL) return;

      var layerRef = doc.activeLayer;

      var layerSetRef = doc.layerSets.add();

      layerSetRef.name = layerRef.name;

      layerRef.move(layerSetRef, ElementPlacement.PLACEATEND);