Hi everyone,
File->Scripts->Load Files into Stack... and I'm loading a bunch of .pdf files as layers into my newly created .psd -
Since the layers get names such as "LayerName.pdf",
I'm wondering how I would iterate over them and right-trim the ".pdf" from their name? (with JS preferably)
Iterating the Layers and renaming
Re: Iterating the Layers and renaming
Code: Select all
(function(){
for(var i = 0, arg = arguments[0]; i < arg.length; i++) {
if (arg[i].typename == 'LayerSet') this(arg[i].layers)
else arg[i].name = String(arg[i].name.split(/\.pdf$/i))
}
})(activeDocument.layers)