[ANN] au3-0.1.0 released

M

Marvin Gülker

Hello Rubyists,

A new version of the au3 gem, which is part of the Automations
project[1], has been released. It's no longer a C extension, but
Ruby-only, thanks to the win32-api gem from the win32utils[2] project,
so there's no need to compile it for every Ruby platform. Just download
it as if it's a normal gem (which it is indeed now).

au3 allows you to automate and simulate (fake) user input to a Microsoft
Windows system. This includes mouse and keyboard simulation as well as
window manipulation. For example:
-------------------------------
require "au3"

#Window manipulation

AutoItX3.run("mspaint.exe")
sleep 1
paint = AutoItX3::Window.new(AutoItX3::Window::ACTIVE_WINDOW)
paint.move(300, 300)
paint.close

#Mouse simulation

AutoItX3.mouse_click(100, 100)
AutoItX3.drag_mouse(0, 0, 50, 50, "Right")

#Keyboard simulation

#Send A, B and C keystrokes, than an
#[ESC] keystroke
AutoItX3.send_keys("ABC{ESC}")
#Same as above, but ignore special
#escape sequences (so send the "{ESC}"
#characters instead of the [ESC] keystroke)
AutoItX3.send_keys("ABC{ESC}", true)

-------------------------------
This library is not only inspired by AutoIt, it uses the DLL interface
that is named AutoItX. For that reason you have to have the
"AutoItX3.dll" file somewhere in your PATH, the easiest way to get it is
just to download AutoIt from http://www.autoitscript.com and copy the
file into your Ruby's bin directory.

This library is Ruby 1.9-only.

Have fun!

Marvin

[1] http://rubyforge.org/projects/auto/
[2] http://rubyforge.org/projects/win32utils/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top