Sign in to follow this  
Followers 0
bogB

if... "case-select" on windows

5 posts in this topic

can someone helpme to understand something how to do it

i have 2 windows that reapire on entering diffrent data

first window

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: my window

Class: #32770

Size: X: 389 Y: 332 W: 254 H: 119

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 736 Y: 749

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xD6D3CE Dec: 14078926

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size:

Control ID:

ClassNameNN:

Text:

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

&Yes

&No

to change or not?

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

and second window same name

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: my window

Class: C/SIDE Glued

Size: X: 412 Y: 282 W: 201 H: 154

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 435 Y: 441

Cursor ID: 5

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xD6D3CE Dec: 14078926

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size:

Control ID:

ClassNameNN:

Text:

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

the only diference is Class: and Visible Window Text that firstone have

so helpme how to do this

WinWaitActive("my window")

case

select if "my window" have Class: "C/SIDE"

send("n")

select if "my window" have Class: "#32770"

send("y")

EndSelect

or at least telme how todo

WinWaitActive("my window")

case

select if "my window" have "to change or not?" text on it

send("n")

select if "my window" dont have "to change or not?" text on it

send("y")

EndSelect

Share this post


Link to post
Share on other sites



or at least telme how todo

WinWaitActive("my window")

case

select if "my window" have "to change or not?" text on it

send("n")

select if "my window" dont have "to change or not?" text on it

send("y")

EndSelect

You're close, just read the help file on WinWaitActive. I copied and pasted the syntax below.

WinWaitActive ( "title" [, "text" [, timeout]] )

Differentiate between the first window using a portion of the included text in the WinWaitActive command.

Select

Case WinWaitActive ("my window", "to change or not")

send("n")

Case Else

send("y")

EndSelect


Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Share this post


Link to post
Share on other sites

Select

Case WinWaitActive ("my window", "to change or not")

send("n")

Case Else

send("y")

EndSelect

but will

Case WinWaitActive ("my window", "to change or not")

command stuck me to wait window with that text, what if he newer popup, and if i add him on WinWaitActive("Untitled", "", 5) il get 5 more sec. that i dont need

is there $var way to set it to "to change or not"

like Visible Window Text on 3 line set to $var

and

case $var == "to change or not"

send("n")

case $var <> "to change or not"

send("y")

?

Share this post


Link to post
Share on other sites

but will

Case WinWaitActive ("my window", "to change or not")

command stuck me to wait window with that text, what if he newer popup, and if i add him on WinWaitActive("Untitled", "", 5) il get 5 more sec. that i dont need

is there $var way to set it to "to change or not"

like Visible Window Text on 3 line set to $var

and

case $var == "to change or not"

send("n")

case $var <> "to change or not"

send("y")

?

It sounds like you are saying you don't want to get stuck in a loop then?

In that case you could use the timer and/or you could read the help file for this command.

AdlibEnable ( "function" [, time] )

It will access a function in AutoIt that you create but don't forget to disable it when you don't need it. Its all in the help file.


Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Share this post


Link to post
Share on other sites

You could try a loop as such.

Global $done
Do
    Select
        Case WinExists('title', 'text')
            WinActivate('title', 'text')
            WinWaitActive('title', 'text')
            Send('whatever')
            $done = True
        Case WinExists('title', 'text')
            WinActivate('title', 'text')
            WinWaitActive('title', 'text')
            Send('whatever')
            $done = True
    EndSelect
Until $done

Use Opt() 4, for title mode to use class names.

:shocked:

Share this post


Link to post
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
Sign in to follow this  
Followers 0