Copy link to clipboard
Copied
If I have a photoshop file open with several layers(for example Layer 0, Layer 1, Layer 2 as their layer names) I would like to manually select Layer 2 selected and run the script to take that name and save my file with that name, Layer2.psd
Thanks
with(activeDocument) saveAs(File(path + '/' + activeLayer.name))
with(activeDocument) saveAs(File('~/desktop/' + activeLayer.name.slice(0, 8)))
Copy link to clipboard
Copied
with(activeDocument) saveAs(File(path + '/' + activeLayer.name))
Copy link to clipboard
Copied
I have a bunch of images in Bridge and I select a few that I want layered in Photoshop so I choose Tools>Photoshop>Load into Photoshop Layers
So then I wrote this,
function flattenSaveWithLayerName() {
with(activeDocument) saveAs(File(path + '/' + activeLayer.name))
}
flattenSaveWithLayerName();
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
Which I want to save my file into a new file (also into another subfolder, But I'll take what I can get) with a specific layers name(another thing I would prefer the new file to only consist of the first 8 letters/numbers from the layer name, again I'll take what I can get)
I get dialog "Error 8103: The document has not yet been saved."
When I run this script on a a multi-layer file that I create by dragging one file onto another it works. Those layers are Background and Layer 1. But I need it to work when the layers are placed with their filename.
Thanks
Copy link to clipboard
Copied
with(activeDocument) saveAs(File('~/desktop/' + activeLayer.name.slice(0, 8)))
Copy link to clipboard
Copied
Wow, Thanks, That does so much with so little. And I have learned alot from it. I named the script file kukurykus.jsx. I'm trying to figure out how to save it to a specific folder on a remote drive, but that looks not possible due to location of the working files not really having a home.