[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

ruby in WinXP as an automation tool

kevin.gc@gmail.com

5/14/2005 7:05:00 AM

Can anyone tell me if it can be done?

14 Answers

Adelle Hartley

5/14/2005 8:40:00 AM

0

Hi Kevin,
>
> Can anyone tell me if it can be done?
>

OLE object browser, in Ruby.

http://homepage1.nifty.com/markey/ruby/win32ole/in...

Adelle.



james_b

5/14/2005 12:43:00 PM

0

kevin.gc@gmail.com wrote:
> Can anyone tell me if it can be done?

Can you give examples of some tasks?

James


RubyTalk@gmail.com

5/17/2005 1:33:00 PM

0

Hello,
AutoIT Does the job well. It has an application that will tell you
window names and lot of nice tools. It uses a vb like lang to program.
Becker

On 5/14/05, Alexey Verkhovsky <alex@verk.info> wrote:
> kevin.gc@gmail.com wrote:
>
> >Can anyone tell me if it can be done?
> >
> >
> Yes.
> This is not a very informative answer, I suppose. What kinds of things
> do you want to automate?
>
> --
> Best regards,
>
> Alexey Verkhovsky
>
> Ruby Forum: http://ruby... (moderator)
> RForum: http://rforum.and... (co-author)
> Instiki: http://i... (maintainer)
>
>


Martin DeMello

5/17/2005 7:36:00 PM

0

ruby talk <rubytalk@gmail.com> wrote:
> Hello,
> AutoIT Does the job well. It has an application that will tell you
> window names and lot of nice tools. It uses a vb like lang to program.
> Becker

http://www.rubygarden.org/ruby?AutoIt_F...

martin

Pit Capitain

5/17/2005 8:25:00 PM

0

Martin DeMello schrieb:
> ruby talk <rubytalk@gmail.com> wrote:
>
>>Hello,
>>AutoIT Does the job well. It has an application that will tell you
>>window names and lot of nice tools. It uses a vb like lang to program.
>
> http://www.rubygarden.org/ruby?AutoIt_F...

I'm also using the AutoIT DLL driven by Ruby scripts. It really works
great and already has saved me a lot of key-presses and mouse-clicks.

Regards,
Pit


Bill Guindon

5/17/2005 9:28:00 PM

0

On 5/17/05, Pit Capitain <pit@capitain.de> wrote:
> Martin DeMello schrieb:
> > ruby talk <rubytalk@gmail.com> wrote:
> >
> >>Hello,
> >>AutoIT Does the job well. It has an application that will tell you
> >>window names and lot of nice tools. It uses a vb like lang to program.
> >
> > http://www.rubygarden.org/ruby?AutoIt_F...
>
> I'm also using the AutoIT DLL driven by Ruby scripts. It really works
> great and already has saved me a lot of key-presses and mouse-clicks.

Anybody have any samples of ruby/au3 scripts that are a bit more in
depth than the wiki example?

> Regards,
> Pit
>
>


--
Bill Guindon (aka aGorilla)


james_b

5/17/2005 11:48:00 PM

0

Bill Guindon wrote:
> Anybody have any samples of ruby/au3 scripts that are a bit more in
> depth than the wiki example?

No. But here's a script I just moved over to Ruby.

On a whim I started wrapping methods so that the core script would be a
bit tidier.

# Launch Firefox and check gmail for that
# special v1agr4 offer
require 'win32ole'

def set_up
@au3 = WIN32OLE.new("AutoItX3.Control")
@au3.opt("WinTextMatchMode", 2)
end

def browse_to( url )
@au3.Run( "e:\\Firefox\\firefox.exe #{url}" )
end

def enter
@au3.Send( "{ENTER}" )
end

def tab
@au3.Send( "{TAB}" )
end


def wait( n )
@au3.Sleep( n.to_i )
end

def send s
@au3.Send( s.to_s )
end

def wait_for_title t
@au3.WinWaitActive( t.to_s )
end


set_up
name = 'my.name'
password = 'fake-password'
browse_to 'http://www.gmai...
wait_for_title "Welcome to Gmail"
# Make sure whole page has
# load over flakey WiFi
sleep 5
send name
tab
send password
enter
# The end.



James


Bill Guindon

5/18/2005 12:28:00 AM

0

On 5/17/05, James Britt <james_b@neurogami.com> wrote:
> Bill Guindon wrote:
> > Anybody have any samples of ruby/au3 scripts that are a bit more in
> > depth than the wiki example?
>
> No. But here's a script I just moved over to Ruby.
>
> On a whim I started wrapping methods so that the core script would be a
> bit tidier.

Thanks much for the example, gives me a good place to start.

--
Bill Guindon (aka aGorilla)


james_b

5/18/2005 1:09:00 AM

0

Alexey Verkhovsky wrote:
> On 5/17/05, James Britt <james_b@neurogami.com> wrote:
>
>>> No. But here's a script I just moved over to Ruby.
>>>
>
> By the way, if I have a .dll (such as AutoIt) somewhere in
> my_project/ext, and I want it to work in "download, start, No Step Three
> (TM)" manner - no changes to Windows registry, no copying of files to
> c:\WINNT, no other installation to speak of.
>
> In this case, what should this line be preceeded with:
> @au3 = WIN32OLE.new("AutoItX3.Control")


Good question. The DLL is going to get loaded, I think, by the WIN32OLE
wrapper, no? So it needs to know where t look, or the dll has to be
someplace it knows to look.

Does the AutoIT.dll have to be registered (via regsvr32 or something)
before win32ole can use it?

Time to go experiment ...

James


james_b

5/18/2005 3:08:00 AM

0

Alexey Verkhovsky wrote:
> James Britt wrote:
>
>> Good question. The DLL is going to get loaded, I think, by the
>> WIN32OLE wrapper, no? So it needs to know where t look, or the dll
>> has to be someplace it knows to look.
>
>
> That's my question, in a more pointed version: how do I tell win32ole to
> look at my_project/ext?

I believe win32ole is going to want to find the COM automation info in
the registry, and you'll need to run

regsvr32.exe AutoItX3.dll

as part of the installation process. But the DLL can go wherever you
like; the location is stored when it gets registered.


James


--

http://www.ru...
http://www.r...
http://catapult.rub...
http://orbjson.rub...
http://ooo4r.rub...
http://www.jame...