Photoshop supports three scripting languages: JavaScript, AppleScript (Mac OS X), and VBScript (Windows). Here's how to decide which language to use:
If you want to be able to run a script that works with both the Mac OS X and Windows versions of Photoshop, use JavaScript.
If you want to be able to write a script that drives Photoshop and other programs, use AppleScript or VBScript. For example, you can write a script to move a document among multiple Adobe Creative Suite programs, processing it each step of the way.
If you only need to control Photoshop and don't need cross-platform compatibility, you can use any of the three languages. In addition, on Mac OS X you can use any language that supports Apple Events, and on Windows you can use any language that supports OLE Automation.