[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

New to Ruby : Can anyone help

Studentfj

3/3/2007 12:36:00 AM

Hi
I am new to Ruby.
What I want to do is to start up an appliacation (GUI
of course) and use Ruby to move the mouse to the
application Button called Start and click on it when
it is active (ie not greyed out).
I can start the application by putting a shortcut in
the XP startup folder, and pass the file as input
parameter but how to use Ruby to move the mouse to
different buttons (three buttons in this app Start
,Continue , Cancel ) in the application windows
and click on it, and also how to test the button is
active before I can click on it.

My normal steps are :-
1) double click on app.exe
2) move mouse to File >> open >> datafile.dat
3) move mouse to the START button ( which is active)
in the application windows and double click the button

Basically I want to automate Step 1 ,2 and 3 above.

Can anyone help
Many thanks
Fred Johnsons



____________________________________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?...

2 Answers

gga

3/3/2007 1:08:00 AM

0

On 2 mar, 21:36, Studentfj <studen...@yahoo.com> wrote:
> 1) double click on app.exe
> 2) move mouse to File >> open >> datafile.dat
> 3) move mouse to the START button ( which is active)
> in the application windows and double click the button
>
> Basically I want to automate Step 1 ,2 and 3 above.
>

What you are asking really has little to do with ruby, but more about
finding hooks in the windows API to do what you want (as it is a
somewhat obscure thing to do, you'll probably find few people that
know how to).
You should ask your question in a windows programming newsgroup and
try searching microsoft's knowledge base and forums for the answer.
If you then want to code the solution in ruby, ruby offers things like
the win32ole and similar modules to give you access to the proper API
calls in windows, but you need to know what those are first.


Pit Capitain

3/3/2007 11:23:00 AM

0

gga schrieb:
> On 2 mar, 21:36, Studentfj <studen...@yahoo.com> wrote:
>> 1) double click on app.exe
>> 2) move mouse to File >> open >> datafile.dat
>> 3) move mouse to the START button ( which is active)
>> in the application windows and double click the button
>>
>> Basically I want to automate Step 1 ,2 and 3 above.
>
> What you are asking really has little to do with ruby, but more about
> finding hooks in the windows API to do what you want (as it is a
> somewhat obscure thing to do, you'll probably find few people that
> know how to).

You could also look at AutoIt (http://www.autoitscript.c...). I
and other people on this mailing list have used it together with Ruby to
automate Windows. You should be able to find some examples in the archives.

Regards,
Pit