Win32ole - wait for action to complete


#1

I have a script driving a proprietary Powerbuilder application via
sendkeys. I am trying to time application processing time. My approach
was grab start time, sendkeys to application, grab finish time and
calculate the diff. However, my four seperate timing steps all print
thier complete timestamps before the application is even done processing
one step. In Marcus Tettmar’s MacroScheduler he has a WaitReady function
that seems to do a good job waiting for the driven event to complete
before continuing execution. I assumed this was making a call to an OLE
function, but have not been able to find such a function. Is there a way
to make my automation script behave in a synchronous fashion so that I
can use it to get accurate timing? Is there a win32ole function for
this? Or is Macroscheduler using its own function to provide this?

I would imagine such a routine could be created using win32event, but I
am very new to Ruby and have no idea where to start to build such a
thing. Would appreciate any input you can provide to set me in the right
direction.


#2

You could use WinBatch http://winbatch.com for this.
You could even call it from Ruby, if need be.

Regards,
JJ

On 05-May-2006, at 11:30, Rich H. wrote:

function, but have not been able to find such a function. Is there a


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


“America goes not abroad in search of monsters to destroy.” – John
Quincy Adams


#3

Thanks. I’m trying to avoid using software I’ll have to license (part of
my rationale for using Ruby for this in the first place vs. using
WinBatch or similar). If this script works, I will want to distribute it
to many machines.

John J. wrote:

You could use WinBatch http://winbatch.com for this.
You could even call it from Ruby, if need be.

Regards,
JJ