Just today, I ran into an issue where some of our production transform software expired (actually the software checks a dongle on the || port). Everytime the software went to transform an AFP to PDF it would throw up 3 registration messages, that had to be manually clicked on each time. This might have been alright if I had a dozen or so files to transform, but in this case I still had close to 5,000. I found the Win32::GuiTest mod on CPAN and it works great! *We already contacted the vendor and once this production run is complete, our software will be complient once again :)
use Win32::GuiTest qw(FindWindowLike SetForegroundWindow SendKeys); while (FindWindowLike(0, "^Elixir Transformation Suite","",0,1)) { my @windows = FindWindowLike(0, "^Key Message","",0,1); for (@windows) { SetForegroundWindow($_); SendKeys("{ENTER}"); sleep(1); } sleep(5); }