AppleScript is an English-like, easy-to-understand scripting language built into every Mac. AppleScript can automate hundreds of AppleScript-able applications, performing tasks both large and small, complex and simple.
Learn AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Third Edition has been completely updated for Mac OS X Snow Leopard. It's all here, with an emphasis on practical information that will help you solve any automation problem--from the most mundane repetitive tasks to highly integrated workflows of complex systems.