ravindram

Set Window Focus

3 posts in this topic

#1 ·  Posted

I am trying to use AutoIt to somewhat automate an installer. Unfortunately the script gets paused because the window will show up but it is not active. Here is my script:

 

Run (setup.exe)
;Bring window into focus
WinActivate ("Patterson Imaging - InstallShield Wizard", "&Next >")
;Wait until window is in focus to continue script
WinWaitActive ("Patterson Imaging - InstallShield Wizard", "&Next >")
;Welcome screen
Send ("!n")
;License Agreement
Send ("!n")
Sleep (7000)
;License Key
Send ("!n")
Sleep (7000)
;License Type
Send ("!n")
Sleep (7000)
;Image Server Name
Send ("!n")
Sleep (7000)
;Summary
Send ("!n")
;Install
Send ("!i")

 

I can see the window when setup.exe launches, but i need to click on it once to have the script continue. What am i doing wrong? 

Share this post


Link to post
Share on other sites



#2 ·  Posted

You might try WinWait (Pauses execution of the script until the requested window exists) just before the WinActivate

Share this post


Link to post
Share on other sites

#3 ·  Posted

49 minutes ago, mikell said:

You might try WinWait (Pauses execution of the script until the requested window exists) just before the WinActivate

 

Looks like that did the trick. Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now