Justin Palmer (of Prototype fame) has a quick tutorial for Scripting Photoshop With JavaScript and Ruby. Even though Photoshop has had support for scripting for a long time now I will bet you that only a small percentage of Photoshop users have any idea that that is the case or even about what scripting is. That is unfortunate because if you are a Ruby developer for instance it opens up an entirely new set of possibilities that already exist, within Photoshop. This tutorial should be enough to get you started, and applying what is in it could for instance enable you to do things like add names to images related to product information stored in a database.
This technique uses a Ruby/AppleScript bridge (RubyOSA) to do most of the heavy lifting.

