Jump to content
Sign in to follow this  
9h0s7

If then with active window

Recommended Posts

9h0s7

Greetings fellow scripters! Here's the low down. I have script that launches a installation. The installation will do one of two things. If it detects that the program is already installed it pop ups a message and the installer quits when you click ok. Or it will proceed through the installation. My problem has been figuring out how to getting to check which on pop ups and take the correction action. Here's what I have so far.

*Note some names have been changed to protect the guilty*

Run("\\pcname\folder\program.exe")

If WinWaitActive("title", "stuff in the box") Then

Send("{ENTER}")

Exit

EndIf

--the above works--

WinWaitActive("title", "stuff")

Send("{ENTER}")

WinWaitActive("title", "stuff")

Send("!a")

Send("{ENTER}")

WinWaitActive("title", "stuff")

Send("{ENTER}")

thanks for the help!

Edited by 9h0s7

Share this post


Link to post
Share on other sites
Paulie

Its very likely that your script Exits when you tell it to.

Run("\\pcname\folder\program.exe")
If WinWaitActive("title", "stuff in the box") Then
Send("{ENTER}")
EndIf
;--the above works--
WinWaitActive("title", "stuff")
Send("{ENTER}")
WinWaitActive("title", "stuff")
Send("!a")
Send("{ENTER}")
WinWaitActive("title", "stuff")
Send("{ENTER}")

Share this post


Link to post
Share on other sites
9h0s7

right, like I said that part works, it's the other part that doesn't. When I run the script and the program is installed the script makes the installer exit. That part works. However, when the program is not installed the script doesn't do anything.

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.