Skip to content

Instantly share code, notes, and snippets.

@lm913
Created December 23, 2015 15:24
Show Gist options
  • Save lm913/5106e1b2cee68349b84f to your computer and use it in GitHub Desktop.
Save lm913/5106e1b2cee68349b84f to your computer and use it in GitHub Desktop.
Creates a New Group within a pre-processing script
function psNewGroup(groupName,vis,lock,showHide){
//"HdAl" - Hides; "RvlA" - Reveal All; "RvlS" - Reveal Selection
var doc = activeDocument;
doc.layerSets.add().name = groupName; //variable must be string
if(!showHide) {showHide=null} else {psNewMask(showHide,null);}
if(vis==false) {doc.layerSets.getByName(groupName).visible = vis} else {lock=null;}
if(!lock) {lock=null} else {doc.layerSets.getByName(groupName).allLocked = lock;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment