Jump to content

Recommended Posts

Posted

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

Posted
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😃

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
  • Recently Browsing   0 members

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