Question
CUSTOM SCRIPT - Filename To Selected Layer...
Hi Everyone - sharing a custom script I made that will change the selected layer to the document's filename. Handy if you need this in your layer setup.
if (app.documents.length > 0 && app.activeDocument.activeLayer) {
var docName = app.activeDocument.name;
var nameNoExt = docName.replace(/\.[^\.]+$/, ''); // remove extension
app.activeDocument.activeLayer.name = nameNoExt;
} else {
alert("No document or active layer selected.");
}
