Jump to content

If then with active window


9h0s7
 Share

Recommended Posts

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
Link to comment
Share on other sites

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}")
Link to comment
Share on other sites

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...