Heres another present.
Ive started doing some mobile marketing and got fed up of manually saving each banner in the different ad sizes.
Luckily Photoshop comes with handy automation tools.
Create a file with the extension .jsx
Save the file in your Photoshop Presents/Scripts folder.
Windows: C:\Program Files\Adobe\Adobe Photoshop CS5\Presets\Scripts
OsX: Applications\Adobe Photoshop CS5\Presets\Scripts
Then just add the following code to that file:
preferences.rulerUnits = Units.PIXELS;
displayDialogs = DialogModes.NO;
// reference the current document open
var doc = app.activeDocument;
//get the filename
var x = separateFileName(doc.name);
var filename = doc.path + "/" + x['filename'];
// set the options you want to use on export
var options = new ExportOptionsSaveForWeb();
options.format = SaveDocumentType.COMPUSERVEGIF;
//options.dither = 0;
// resize
resizeSave(300,50);
// resize
resizeSave(216,36);
// resize
resizeSave(168,28);
// resize
resizeSave(120,20);
function resizeSave(width, height) {
doc.resizeImage(width,height,72,ResampleMethod.BICUBICSHARPER);
doc.exportDocument(new File( filename + "-"+width+"x"+height+".gif" ), ExportType.SAVEFORWEB, options);
}
function separateFileName(theFileName){
if (/\.\w+$/.test(theFileName)) {
var m = theFileName.match(/([^\/\\]+)\.(\w+)$/);
if (m)
return {filename: m[1], ext: m[2]};
else
return {filename: 'no file name', ext:null};
} else {
var m = theFileName.match(/([^\/\\]+)$/);
if (m)
return {filename: m[1], ext: null};
else
return {filename: 'no file name', ext:null};
}
}
// resize resizeSave(300,50);
Oh - almost forgot
The files will be saved wherever your main PSD is saved. If the resized filenames already exist, then the script will exit with an error.
I'm getting this error.

this looks like an awesome tool but i keep getting the following error: http://cl.ly/image/0j421h0e2K00
any clue how to fix?
Are you running Photoshop CS5, or a later version?
Does this automatically save the banner as PSD or JPG? Because if its PSD, then I would have to save it as a JPG because most traffic sources that I work with only accept JPEG/GIF.
It saves as a gif.
So when you use this script, then photoshop automatically saves the banner is each size that you request (315x300 300x250 etc.)?
And can it save automatically as a JPG?
^^ yep correct. You can also make it save in any file format you wish by tweaking the script.
You sir are my hero!! Thank you so much!
Do you have any idea if it is possible to integrate it with Adobe Fireworks?
I don't think so, I'm afraid. I believe Photoshop and Fireworks have different scripting languages.