I've been meaning to investigate AppleScript. I saw a link to this tutorial and it looks promising. Apple provides a Script Menu in 10.2.