> which I can call via system("perl dismiss.pl") in Ruby.  I can't seem to
> get the synchronization right though as I call ie.form().button().click
> right beforehand.
>
> Suggestions? I'm aware of the AutoIT interface but I've had more luck with
> the
> perl script working correctly when I execute it manually.

I like this solution, I've had it in my back pocket for some time now.
 Instead of calling the Perl script from Ruby, call the Ruby script
from Perl, like so:

use Win32::GuiTest qw(FindWindowLike GetWindowText
SetForegroundWindow SendKeys);

system (1, "C:\\ruby\\bin\\ruby.exe script.rb");
while (1) { #INFINITE LOOP
sleep 5; #CHECK FOR NEW WINDOW EVERY 5 SEC
my @windows = FindWindowLike(0, "^Microsoft Internet Explorer"
);
for (@windows) {
SetForegroundWindow($_); #BRING THE RIGHT WINDOW IN FOCUS
SendKeys("{ENTER}");
}
}

That "system (1, foo) is magic-- it returns control to the calling
(Perl) script.  This way your Perl script loops, happily finding and
dismissing windows, while your Ruby script runs around generating
them.

-Chris

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to