Created
December 23, 2015 15:25
-
-
Save lm913/48339bee47ad691e9ed4 to your computer and use it in GitHub Desktop.
Creates a New Layer within a pre-processing script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function psNewLayer(layerName,vis,lock,showHide){ | |
//"HdAl" - Hides; "RvlA" - Reveal All; "RvlS" - Reveal Selection | |
var doc = app.activeDocument; | |
if(app.activeDocument.activeLayer.isBackgroundLayer){ | |
app.activeDocument.activeLayer.name = layerName; //variable must be string | |
} else { | |
doc.artLayers.add().name = layerName; //variable must be string | |
} | |
if(!showHide) {showHide=null} else {psNewMask(showHide,layerName);} | |
if(vis==false) {doc.layers.getByName(layerName).visible = vis} else {lock=null;} | |
if(!lock) {lock=null} else {doc.layers.getByName(layerName).allLocked = lock;} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment