[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

win32ole

Agustín Ramos

7/11/2007 11:55:00 PM

Hi everybody, i´m trying to manage the mouse with Ruby. Like move it in the
Desktop, clicking de Start button, like a macro.

Well, i would like to recive some information about that.

Thanks!

_________________________________________________________________
Las mejores tiendas, los precios mas bajos, entregas en todo el mundo,
YupiMSN Compras: http://latam.msn.co...


3 Answers

Todd Burch

7/12/2007 2:06:00 AM

0

Agustín Ramos wrote:
> Hi everybody, i?m trying to manage the mouse with Ruby. Like move it in
> the
> Desktop, clicking de Start button, like a macro.
>
> Well, i would like to recive some information about that.
>
> Thanks!

I'm fairly new to to win32ole myself, but I see it as more of a "ole"
interface (hence the name) than a "programming interface" (aka, API, as
in WIN32API).

Perhaps WIN32API is what you are searching for.

Now, certain applications that you might "new up" with WIN32OLE have
functions, like Excel has "sendleys()" where you can mimis keystokes.
Perhaps that is what you want to do.

They also have events, and you can set up event handlers. Study the
Object Model of the windows application you want to drive.

What I have found is this:

IF I knew the Object Model for the application I wanted to drive with
Ruby,
THEN actual implementation is pretty straight forward.
ELSE, without knowing the object model, you'll find youself staring at
the screen.

Todd

--
Posted via http://www.ruby-....

Harry Kakueki

7/12/2007 3:40:00 AM

0

> Hi everybody, i´m trying to manage the mouse with Ruby. Like move it in the
> Desktop, clicking de Start button, like a macro.
>
> Well, i would like to recive some information about that.
>

You can move and click the mouse with AutoIt.
Try playing around with this code to get you started.
Use carefully.

require 'win32ole'
mytest = WIN32OLE.new("AutoItX3.Control")

mytest.MouseMove(150,440)
sleep 1
#mytest.MouseDown("Left")
#mytest.MouseUp("Left")
mytest.MouseMove(250,240)
sleep 1
mytest.MouseMove(350,340)


Harry

--
A Look into Japanese Ruby List in English
http://www.ka...

greg.kujawa

7/12/2007 2:04:00 PM

0

On Jul 11, 11:39 pm, "Harry Kakueki" <list.p...@gmail.com> wrote:
> > Hi everybody, i´m trying to manage the mouse with Ruby. Like move it in the
> > Desktop, clicking de Start button, like a macro.
>
> > Well, i would like to recive some information about that.
>
> You can move and click the mouse with AutoIt.
> Try playing around with this code to get you started.
> Use carefully.
>
> require 'win32ole'
> mytest = WIN32OLE.new("AutoItX3.Control")
>
> mytest.MouseMove(150,440)
> sleep 1
> #mytest.MouseDown("Left")
> #mytest.MouseUp("Left")
> mytest.MouseMove(250,240)
> sleep 1
> mytest.MouseMove(350,340)
>
> Harry
>
> --
> A Look into Japanese Ruby List in Englishhttp://www.ka...

Here's a link to the AutoIt website (http://www.autoits...
autoit3/index.php) where you can download the program. This is a handy
utility for sure. I script it with Ruby for doing lots of monotonous
keyboard entry in old DOS programs that I have shelling out after
hours. I just pick up the DOS box's window title and then go to town!