A friend of mine mentioned that he expectantly spent a few hours with glazed over eyes clicking “C” on the keyboard to press “Continue” on a dialog box that was being generated a few hundred times. He quickly acknowledged that there was definitely a better way to use his time and accomplish the task at hand with some bit of code that would prevent the need for clicking a dialog box button over and over, but sometimes we just end up in that frustrating place where that’s just what has to be done.
I immediately thought of AutoIt (http://AutoItScript.com) which is an awesome scripting language that Jonathan Bennett developed many years ago and continues to improve. AutoIt can do many things easily and well, but one place it excels at is GUI management. PowerShell, VBScript, KiXtart, and others can certainly send key presses, but AutoIt can do much better. It can programmatically “click” buttons by name or control ID. The greatness of this is that the dialog box doesn’t need to be “active” or even visible. I’ve used this process hundreds of times in a former role to drive software installations where MSI’s didn’t exist and repackaging was unacceptable.
Here is a code snippet that will indefinitely watch for a dialog box and click the first button.continue reading on CatapultSystems.com