Applescript and Photoshop Thumbnail Generator

I'm not sure how many computer geeks read this blog, but just in case there are, hopefully you'll find this useful. (Note: you'll need a Mac and Adobe's Photoshop.)

In my work, I sometimes need to resize a bunch of images for web photo galleries. If you have ever done that, you know how tedious it can be. Thankfully, Photoshop and Fireworks both have batch editing functionality, and it usually does the trick.

Then, recently I learned about Apple's built-in Automator, and got excited about customizing my batch processes. But, even though Automator did the trick, (and with the help of these scripts, I was able to do more with Photoshop), I needed something more specific, with more customization.

Well, Automator is just a bunch of AppleScript, right? So why not just learn a little AppleScript and make my own script to resize images exactly how I need? That's what I've done. Right now it can resize images (only JPEGs) in three ways — proportional by width, longest side, and square. And it takes advantage of Photoshop's "Save for Web" feature, which is great for getting high quality images in small file sizes. In the future I will add support for renaming options.

Here's how you use it

  1. Download the script and unzip it. You can either use the standalone application, or place it script in your ~/Library/Scripts directory. If you use the script, choose "Generate Thumbnails" in the Script Menu, which is located in the right side of your menu bar. Otherwise, just start the application.
  2. Set your parameters (the resizing method, source files, destination folder, and size of thumbnails).
  3. Sit back and watch your computer do all the work!

Changelog

  • v1.4 (Oct 23, 2007) - Added support for positioning the square crop, so it doesn't have to be centered anymore, using Finder's color labels (red means top, or left, and gray means bottom, or right).
  • v1.3 (Jun 26, 2007) - Fixed decimal-pixel bug by rounding to nearest pixel on resize.
  • v1.2 (Jan 20, 2007) - Added support for "proportional by width" and "longest side".
  • v1.1 (Jan 19, 2007) - Fixed problem where it wasn't resizing correctly.
  • v1.0 (Jan 18, 2007) - First version of script, only resizes to a square.