Jump to content

Winexists/winactive IF block, not recognising the window is there


Recommended Posts

Hi folks

Been lurking for a while to build previous scripts but this has me stumped. 

I'm automating a login via an IBM iSeries data transfer component. This script requires an IF check as a recognised address will go to a standard user/pass form and if its a new address a different window will pop with some more options, and ultimately leads back to the same user/pass prompt. 

My script is something like;

If winexists ("IBM i signon information","Prompt every time") _
Or winactive ("As above", "As above" Then
Msgbox ("Entered If Block"

.....
.....
.....

Else
Msgbox ("entered else block")

The if block is never entered and the title, text are exact. I've tried using the handle different visible text. 

Tried forcing the check for hidden text and child windows.

The class of this window is the exact same as every other window used by this exe (#32770)

 

Really at a loss as to why I can't get to pass the IF check. 

 

TIA for any help and advice! 

Link to comment
Share on other sites

Totally the ampersand,  Ive yet to see  anything work right trying to match &

Also get rid of the spaces at the start of the title

WinActive("[TITLE:My Window]", "")

next WinWait, WinActive,  WinExists, WinWaitActive and their ilk all return a handle to the matched window on success

rather than trying to get a match each subsequent time pass the hWnd you already matched

Local $hWnd = WinWaitActive(....)

ControlClick($hWnd,"", "........")

 

Edited by Bilgus
Link to comment
Share on other sites

Thanks all, got it fixed now. 

The square brackets and ampersand seemed to do the trick. I assumed if autoit could see that actual text with that character then that's what it should be. 

Really appreciate the quick advice guys, thanks! 

 

 

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...