You can use Image Processor (Scripts:Image Processor) to resize to fit in a specific size. It will resize to fit inside those dimensions. You can save out as a PSD, Jpeg and/or TIFF. You can also specify an action to run, create an action to use the clipping path as a mask on your layer. You might need a few extra steps to make sure the action works with all of your images (e.g. merge visible before masking in case there are multiple layers).
If the image processor doesn't get you all of the way to where you want, or the output isn't what you need (e.g. gif, png), you can set the output to PSD, and run another batch action on the resulting files to finish the job.
Paul.... That is great stuff. Thank you so much!
I just ran it on a folder to test it out, and it works great, although I noticed a few files had oddities in their names. Here is an example:
That's the filename, and it is missing the .jpg extension. Perhaps the original filename was too long? The same thing happens on the other 2 size versions of this image.
Did you create this using the Image Processor script as the base? The reason I ask is because I had tried the Image Processor a little bit before you replied, and although it wasn't the complete solution I needed, it did have two different things that would be great to have in your script. So basically, if it'd be easy to copy and paste those things from the Image Processor script into yours, than I'd ask.... but if it's complicated, I wouldn't trouble you, because you've already been kind enough to write me a version of your script.
The two things are:
the ability to include sub-folders (i have 100+ sub-folders)
and the way Image Processor creates a folder called JPEG in every folder/subfolder, for the processed images.
Your script is already saving me enough time, that I can use it as is. but if it's an easy copy/paste to add those 2 Image Processor functions, I'd be thrilled to have them.
The problem with filename could be a setting within Photoshop, try this...
Open a document in Photoshop then ..
File - Save for Web & Devices
at the right hand side of the preset dropdown box there is a downarrow click this and select edit output settings.
Keep clicking next until you see "Filename Compatibility" and untick "Mac OS 9"
No it isn't based on "Image Processor" it was based on my Save For Web CS4.
The script will need to have a fairly major change to add those options, so I will have a look at it tomorrow Sean.
I was asked to add a size to the script. I cracked it open myself and changed this section:
app.activeDocument.resizeCanvas(400, 400, AnchorPosition.MIDDLECENTER);
if(win.panel0.Progressive.value) Progressive = 4;
doc.resizeImage(undefined, 200, undefined, ResampleMethod.BICUBICSMOOTHER);
ext = "-200.jpg";
doc.resizeImage(undefined, 115, undefined, ResampleMethod.BICUBICSMOOTHER);
ext = "-115.jpg";
doc.resizeImage(undefined, 80, undefined, ResampleMethod.BICUBICSMOOTHER);
ext = "-80.jpg";
All I did was copy the lines for the 115 size, and change them to 200. And I changed the "Progressive =" from 3 to 4, which was just a guess.
I tested it out and it worked fine.