Go to content Go to navigation

One thing I hate about Photoshop is the lack of a Save All option. It might well be the only thing I hate about it, really.

Picture yourself coming from a photo-shooting session, you have 4GB of RAW files to edit. Would you also want to save one by one? Think not.

So, as we all know, Photoshop is a great application and compensates that supporting event-based scripts in several languages (Javascript, VBScript and AppleScript). These scripts will tell Photoshop what to do, automatically. You just have to press the button.

I've searched around and found this interesting topic on kirupa.com

For the sake of this article I'll post the code for the Save All action:

var tempFolder = new Folder ("C:/Your_Temporary_Folder")
tempFolder.create();

var DL = documents.length;

for(a=1;a<=DL;a++){

activeDocument = documents[a-1];
var AD=activeDocument;
var imgName= AD.name;
imgName = imgName.substr(0, imgName.length -4);
AD.flatten();


saveFile = new File("C:/Your_Temporary_Folder/"+imgName+".jpg");
saveOptions = new JPEGSaveOptions();
saveOptions.embedColorProfile = true;
saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
saveOptions.matte = MatteType.NONE;
saveOptions.quality = 12;
AD.saveAs(saveFile, saveOptions, true,Extension.LOWERCASE);
}

Save it with a .js extension and open it on Photoshop (Menu File > Scripts). This example saves JPEG files with level 12 compression; you might want to change the output quality or the format itself.
This code was written by mlk (mlkdesign -at -online.fr) with a few changes by me.
You can download the original one here.

You also might want to check other useful scripts:

Kudos to Tab Mix Plus extension for Firefox which allowed me to recover this post :)

keoshi.com is the online portfolio of freelance web developer and graphic designer Filipe Varela.
You're currently reading a blog article, be sure to check my Portfolio.

14 Responses to "Saving all images in Photoshop"

Nice :), é muito mais fácil do que usar as actions, que tb fazem o serviço, mas de um modo diferente, lol.

Helder Almeida  @  14 October 2006, 23:57    #

Podes crer!

Enviei uma resposta ao teu mail mas acho que veio para trás, podes confirmar?

keoshi  @  15 October 2006, 01:15    #

Boas, pois não recebi nenhum mail teu, mas se quiseres podes voltar a enviar. Cumps.

Helder Almeida  @  18 October 2006, 00:44    #

Tank U im Iranian
Very very nice Webloging

omiD  @  23 October 2006, 14:28    #

Descobri o teu site quando fui sacar o update do textpattern e tava por lá algures um comment teu, seguido de um que me fez vir cá:

“Wow! Keoshi, your site is cool, why don’t I find it on CSS Beauty? =) Maybe I submit your site on every CSS gallery I can find…”

É bom saber que se faz bom trabalho “standard-compliant” e graficamente muito bom em PT :)

keep it up m8 :)
kudos,
~Levi F. aka EinZteiN

PS: já agora, em relação ao post concrectamente (lol), sempre achei muito estranho, uma aplicação do “pedigree” do PS não trazer um “Save All” e até algumas opções de “batch” imbutidas nessa função… Enfim… Nem a Adobe é perfeita né? :p (makes you feel better about yourself huh? :D)

Levi Figueira  @  26 October 2006, 14:18    #

thanks for sharing :D

kus  @  20 November 2006, 07:37    #

Great Post.
I used your script, and changed it to make png file instead by changing to :
var pngFile = new File(“C:/Your_Temporary_Folder/”imgName”.png”)

pngSaveOptions = new PNGSaveOptions(); pngSaveOptions.embedColorProfile = true; pngSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE; pngSaveOptions.matte = MatteType.NONE; pngSaveOptions.quality = 1;
app.activeDocument.saveAs(pngFile, pngSaveOptions, true, Extension.LOWERCASE);
}

I am having problems with it though. the transparencty goes away. Could you please advice.

I am trying to write text in a layer.
Do you use AIM?

Mark  @  22 July 2007, 06:29    #

you are a bloody genius! you know that!

tuluks  @  8 November 2007, 09:37    #

awesome! thank you so much!

tom  @  5 February 2008, 01:35    #

Could you maybe post this, but using the “Save For Web” option instead? Those file sizes are much smaller, with roughly the same quality to the eye

ben  @  7 February 2008, 23:41    #

This is brilliant! Many thanks for sharing. I have only recently got into ‘proper’ photography as a hobby and for my nice photos am using RAW and PS to tweak. Save All feature definitely a missing part of PS but this JS seems to do the job perfectly – thanks!

LeoLondonUK  @  9 April 2008, 22:59    #

photoshop cs3: files>scripts>export layers to files…

home  @  28 January 2009, 02:54    #

Can someone explain what i need to do after loading the script?

nsv  @  12 June 2009, 18:11    #

You just have to navigate to:
C:/Your_Temporary_Folder
and your images should be there.

Assuming you haven’t changed the script; you can change the directory on the first line of the script.

Cheers

keoshi  @  12 June 2009, 19:38    #

Leave A Reply

You can use Textile to format your comments.