in reply to Win32::GuiTest sendkeys
I'm using WIN::GuiTest to interface with a GUI.... I would like to use SendKeys to enter some text. Will SendKeys work with variables. exampe: SendKeys($x); I can't get the variable to expand.
Minimal example? I just installed the module, adapted the code in the synopsis to the following:
#!/usr/bin/perl use strict; use warnings; use Win32::GuiTest qw/FindWindowLike SetForegroundWindow SendKeys/; my @windows = FindWindowLike(0, 'Senza nome - Blocco note'); for (@windows) { SetForegroundWindow($_); my $x="Foo Bar Baz%fv"; SendKeys($x); } __END__
And it works as expected: I open notepad before launching it, and when I launch it, it writes there "Foo Bar Baz" and then opens the "save as" dialog box.
|
|---|