blazz0r Posted August 3, 2006 Share Posted August 3, 2006 I'm executing a script that checks for a window, and if there performs an action then closes the entire process. For some reason though when I added an IF conditional nested within an While statement it broke the script. When running the script it now says that the "WEnd" statement with no matching "While" statement. The syntax appears correct to me (I've been scripting for 2 years and programming for 4). Could someone take a look at this and see what's up? Opt("WinTitleMatchMode", 2) While WinExists("- Microsoft Virtual PC 2004") Run("C:\Program Files\Microsoft Virtual PC\Virtual PC.exe") WinWaitActive("Virtual PC Console") Send("!a") Send("c") If WinExists("", "What do you want the virtual machine to do?") Then WinActivate("", "What do you want the virtual machine to do?") $CloseTxt = WinGetText("Close") While NOT StringInStr($CloseTxt, "Turns off virtual machine and saves all changes.") Send("t") $CloseTxt = WinGetText("", "What do you want the virtual machine to do?") WEnd Send("{ENTER}") End If Wend ProcessClose("Virtual PC.exe") Link to comment Share on other sites More sharing options...
Helge Posted August 3, 2006 Share Posted August 3, 2006 End If should be EndIf. Link to comment Share on other sites More sharing options...
blazz0r Posted August 7, 2006 Author Share Posted August 7, 2006 End If should be EndIf.Thanks Helge, guess I've been using VBS a bit much lately. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now