1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#target photoshop cTID = function(s) {return app.charIDToTypeID(s);}; sTID = function(s) {return app.stringIDToTypeID(s);}; var layernames = ["Sliced+1","Sliced+2","Sliced+3","Sliced+4","Sliced+5"]; // Array of Layer Names if(app.documents.length>0){ var doc = app.activeDocument; Deselect_Layers(); var myLyr = doc.artLayers; for (var i = 0; i < layernames.length; i++) { addtoSelection(layernames[i]); } } function Deselect_Layers() { var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt')); desc1.putReference(cTID('null'), ref1); executeAction(sTID('selectNoLayers'), desc1, DialogModes.NO); }; function addtoSelection(layerName){ var desc71 = new ActionDescriptor(); var ref65 = new ActionReference(); ref65.putName( cTID( "Lyr " ), layerName ); desc71.putReference( cTID( "null" ), ref65 ); desc71.putEnumerated( sTID( "selectionModifier" ), sTID( "selectionModifierType" ), sTID( "addToSelection" )); desc71.putBoolean( cTID( "MkVs" ), false ); executeAction( cTID( "slct" ), desc71, DialogModes.NO ); } |
Leave a Reply
Want to join the discussion?Feel free to contribute!