AutoIt is a Windows tool to automate UI tasks, for testing or scripting. It supports basic commands like moving the mouse, clicking its buttons, simulating keystrokes. Beyond that it also recognizes windows controls and can interact with them easily. It sports a scripting language to write macros, with loops, ifs, etc.
I'm looking for an equivalent of this for Mac OS X. It should at least support the basics, allowing me to script mouse and keyboard input, but the rest of AutoIt's features would be very welcome too.