mikeDoc Posted June 27, 2022 Share Posted June 27, 2022 Hello All, I have a AutoIt script that want to check the title of the GUI first before it go to the next step. I have one windows with two names(PageA, PageB) depends on different situation. In situation A, the title is 'PageA', in situation B, the tile is 'PageB'. I use WinExists to get it, but I get an error said that "unbalanced paranthesis expression" on line 'If (WinExists("PageA", "") Then ' If (WinExists("PageA", "") Then Log("Open (PageA) Windows") If Not (ControlClick("Active", "tool1", "[NAME:XXX]", "primary", 1, 50, 235)) Then ReportError("Fail to open PageA windows") If Not (WinWait("PageA", "", 10)) Then ReportError("Fail to open PageA Windows") If Not (WinActive("PageA", "")) Then WinActivate("PageA", "") .... If Not (WinClose("PageA")) Then ReportError("Fail to close PageA windows") Else Log("Open (PageB) Windows") .... If Not (WinClose("PageB")) Then Error("Fail to close PageB windows") EndIf Link to comment Share on other sites More sharing options...
abberration Posted June 27, 2022 Share Posted June 27, 2022 If WinExists("PageA", "") Then For every open bracket, you need a closed bracket. Your original statement, you have two open and one closed. The one before WinExists is not needed, so you can just get rid of it. Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
mikeDoc Posted June 28, 2022 Author Share Posted June 28, 2022 21 hours ago, abberration said: If WinExists("PageA", "") Then For every open bracket, you need a closed bracket. Your original statement, you have two open and one closed. The one before WinExists is not needed, so you can just get rid of it. Oh! There have two open bracket! Thanks for the explanation😃 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