views:

321

answers:

3

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.

+1  A: 

The closest you will probably get is applescript (http://developer.apple.com/mac/library/documentation/applescript/conceptual/applescriptx/AppleScriptX.html) It is the closest I've found for native OS X scripting.

MaQleod
AppleScript *is* native OS X scripting! For those applications that do not provide a sufficiently rich AppleScript interface for your needs, there is the last resort option of AppleScript GUI Scripting, which allows you to manipulate user interface elements like simulating mouse clicks etc. But, for many applications, you don't need to script at that level. http://developer.apple.com/mac/library/documentation/AppleScript/Conceptual/AppleScriptX/Concepts/as_related_apps.html
Ned Deily
A: 

You could reduce this problem to the more general one of finding an AutoIt equivalent based on the VNC protocol. Then launch a VNC server on your Mac (several are available, Snow Leopard even has one built in).

In fact, if I intended to build a piece of software with the functionality you describe, I would start with the VNC protocol and existing client/server implementations. There is even the possibility this is what AutoIt's implementors did.

Pascal Cuoq
If you're thinking about automating tasks on a server, I agree, but I'm not. I want to automate tasks on my desktop without having to use a second computer to do that.
Marcel Offermans
@Marcel Offermans I was thinking of running AutoIt in a Windows virtual machine on the same computer. It is a little bit contrived.
Pascal Cuoq
A: 

It's still kind of new, and it's based on AutoHotkey, not AutoIt... but the closest thing I know of is IronAHK, a complete re-write of AutoHotKey using Mono so that it may run on Windows, Linux, Mac OS X, and other UNIX systems. http://www.autohotkey.com/forum/topic54494.html

May or may not be what you need, but I thought I'd throw it out there.

JohnForDummies
Thanks for the pointer. I tried downloading it (and Mono) but the stable version I cannot get to run and the nightly is broken. No documentation yet. I'm going to track the project to see if it improves up to the point where I can run a script without having to mess around with it for more than an hour. :)
Marcel Offermans