Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Save psd file with the selected layers name script help

Community Beginner ,
Jul 24, 2021 Jul 24, 2021

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

TOPICS
Actions and scripting, macOS

Views

123

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Adobe Community Professional , Jul 25, 2021 Jul 25, 2021
with(activeDocument) saveAs(File(path + '/' + activeLayer.name))

Likes

Translate

Translate
Adobe Community Professional , Jul 27, 2021 Jul 27, 2021
with(activeDocument) saveAs(File('~/desktop/' + activeLayer.name.slice(0, 8)))

Likes

Translate

Translate
Adobe Community Professional ,
Jul 25, 2021 Jul 25, 2021

Copy link to clipboard

Copied

with(activeDocument) saveAs(File(path + '/' + activeLayer.name))

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 27, 2021 Jul 27, 2021

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 27, 2021 Jul 27, 2021

Copy link to clipboard

Copied

 

with(activeDocument) saveAs(File('~/desktop/' + activeLayer.name.slice(0, 8)))

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 28, 2021 Jul 28, 2021

Copy link to clipboard

Copied

LATEST

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines