JRGN Posted October 11, 2016 Share Posted October 11, 2016 Hi Everyone, I got a little problem with trying to create a script to automate a remote desktop application that I use on a daily basis. Here is the problem: Part of my script is waiting for a new window after selecting from the main app. The problem is that window title changes depending the information you click. Here is the code so you can check it: Local $sPO = PO NUMBER WinWait("Purchase Order: " & $sPO &" (Remote)","",60) if WinExists("Purchase Order: " & $sPO &" (Remote)") = 1 Then Local $sTemp2 = "Purchase Order: " & $sPO &" (Remote)" MsgBox($MB_SYSTEMMODAL, "INFO1", $sTemp2) ;just for debug purposes Else Do MsgBox($MB_SYSTEMMODAL, "DEBUG INFO", "") ;just for debug purposes sleep(3000) Local $sTemp2 = " (Remote)" MsgBox($MB_SYSTEMMODAL, "INFO2", $sTemp2) ;just for debug purposes until WinWait(" (Remote)"," (Remote)","") EndIf WinActivate($sTemp2,"") Example #1 (Using the $sPO = JOEL011A) (00.JPG and 01.JPG) The script runs perfectly, enters on the if statement, assigns the $sTemp2 variable the name of the window, and then continues to WinActivate, the process continues flawlessly. Example #2 (Using the $sPO = 1020145428) (02.JPG and 03.JPG) The scripts enter into the if statement, because the window title is " (Remote)", the script goes to the else statement, but do not exits the WinWait, but continues looping, therefore the window never gets activated by WinActivate. What I am doing wrong? Please help, thanks, regards. 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