This content has been marked as final.
Show 3 replies
-
1. Re: Is there a way to gather all shape layer and all text layers?
jl2000 Sep 26, 2011 12:53 PM (in response to jl2000)Sorry - I hit Enter before I was done with my question.
Is there a way to use either an Action or a script to put all the Text layers and Shape layers in a Group named "Labels and Arrows"? I tried using Actions but there is a different number of Shape layers in each file. Results were not good. Same with the Text layers.
I need to be able to gather the layers by their "function" rather than layer name.
TIA any suggestions
jl
-
2. Re: Is there a way to gather all shape layer and all text layers?
c.pfaffenbichler Sep 27, 2011 12:22 AM (in response to jl2000)Does this help?
// move text and solid fill layers to newly created folder; // 2011, use it at your own risk; #target photoshop if (app.documents.length > 0) { var myDocument = app.activeDocument; var theSet = myDocument.layerSets.add(); theSet.name = "Labels and Arrows"; var theLayers = moveLayers(app.activeDocument, theSet); }; ////// function to move certain layers ////// function moveLayers (theParent, theSet) { if (!allLayers) {var allLayers = new Array} else {}; for (var m = theParent.layers.length - 1; m >= 0;m--) { var theLayer = theParent.layers[m]; // apply the function to layersets; if (theLayer.typename == "ArtLayer") { if (theLayer.kind == "LayerKind.TEXT" || theLayer.kind == "LayerKind.SOLIDFILL") { alert (theLayer); theLayer.move(theSet, ElementPlacement.PLACEATBEGINNING) } } else { if (theLayer != theSet) { moveLayers(theLayer, theSet) } } }; }; -
3. Re: Is there a way to gather all shape layer and all text layers?
jl2000 Sep 27, 2011 9:13 AM (in response to c.pfaffenbichler)c.pfaffenbichler -
very nice! thank you.
jl


