Just Google "After Effects Scripting Guide". The top entry will take you to the pdf for CS3. For changes since CS3, you'll need to check out Todd Kopriva's blog. Here's the link to the CS4 changes:
http://blogs.adobe.com/toddkopriva/2008/12/after-effects-cs4-scripting-ch.h...
You'll also want to look at Adobe's JavaScript Tools guide, which covers file I/O, UI, and a bunch of other stuff. You can get to it from the Help menu of the ExtendScript Toolkit (from AE: File > Scripts > Open Script Editor; then Help > JavaScript Tools Guide).
Dan