SCRIPT - LAYER (INCL NAME) TO GROUP...
I’ve created a script that will create a layer group from a selected layer and the group will take on the name of the selected layer. Sharing here for anyone that can use it. It’s very handy.
var d = new ActionDescriptor();
var r = new ActionReference();
r.putClass(stringIDToTypeID("layerSection"));
d.putReference(stringIDToTypeID("null"), r);
var r1 = new ActionReference();
r1.putEnumerated(stringIDToTypeID("layer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(stringIDToTypeID("from"), r1);
var d1 = new ActionDescriptor();
d1.putString(stringIDToTypeID("name"), app.activeDocument.activeLayer.name);
d.putObject(stringIDToTypeID("using"), stringIDToTypeID("layerSection"), d1);
executeAction(stringIDToTypeID("make"), d, DialogModes.NO);
Note: For anyone who hasn’t used scripts in Photoshop you need to past the above text into a simple text file (e.g. using an app like Notepad, Notepad ++, etc.) and change the file extension tag to .jsx - load this file as a script in Photoshop and you’re good to go.
