I second Sikuli and recommend Sikuli-X. In the end though the company I work for wanted to use a corporate supported solution so I now use UiPath. It is allowing us to automate repetitive tasks in a Win32 application that uses shdocvw.dll as the shell for Silverlight components, and an embedded TTY emulator among other things. Pointing Spy++ at it revealed an almost infinite event model. Automating with Windows handles just wasn't possible, so the OCR of both Sikuli and UiPath came in handy.
Sikuli's big advantage is that it is cross-platform. If you are on Windows, KantuX does the same but optimised for Windows desktop automation.
Wow, I was thinking of RobotFramework and I found it mentioned in SikuliX. Thanks a million. :-D
Never heard of it. Love that is Python scriptable. Thanks for sharing.