Jump to content
Sign in to follow this  
mattfaust

please help with controlclick

Recommended Posts

mattfaust

I need to click a button on a pop-up, and I cant seen to get it to work.

There is only one button on this popup labeled close, I cant seen to pick it up

here is the info on the button I need to click, thanks for any help

Press CTRL-ALT-F to pause the display.

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

Title: iScope v2.24.3

Class: MDIframeCL28484736

Size: X: -4 Y: -4 W: 1288 H: 780

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

Screen: X: 536 Y: 442

Cursor ID: 2

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

RGB: Hex: 0xEBEBE6 Dec: 15461350

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

Size: X: 511 Y: 394 W: 45 H: 23

Control ID: 29799

ClassNameNN: Button1

Text: Close

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

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

Run Tasks Immediately

Selected Tasks Finished

Close

Graphic Formatting:

New

Open

Save

Add System

Back

Forward

Zoom In

Zoom Out

Scroll

Test

Connect

Point View

&Open System

&Graphics

&Close

&Disconnect

E&xit

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

Iscope

Share this post


Link to post
Share on other sites
automagician

WinActivate("iScope v2.24.3")
WinWaitActive("iScope v2.24.3")
ControlClick("iScope v2.24.3", "", 29799)

ControlClick looks for the Control ID, which in this case is 29799 :)

Edited by automagician

Share this post


Link to post
Share on other sites
mattfaust

well, Ive tried that and it seems to send the buttton press but to soon as the main application is also labled iscope v2.24.3

so

WinWaitActive("iScope v2.24.3")

is always active this is a popup with the same title.

I am very new to autoit, and Im sure there is a simply solution But I dont know it.

any thoughts?

Share this post


Link to post
Share on other sites
MHz

Why not use WinClose() ?

Share this post


Link to post
Share on other sites
automagician

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

Try adding text to WinWaitActive that is specific to the box with the close button that you are trying to click.

or WinClose() if the button click isn't important.

Let me know if that helps...

Edited by automagician

Share this post


Link to post
Share on other sites
SlimShady

Method 1

ControlClick("iScope v2.24.3", "", "Button1")

Method 2

ControlClick("iScope v2.24.3", "", "Close")

As MHz suggested, WinClose

Method 3

WinClose("iScope v2.24.3")

Share this post


Link to post
Share on other sites
mattfaust

Why not use WinClose() ?

<{POST_SNAPBACK}>

That may be an option, I need to wait till this popup is active to ensure the process the script started is complete, but perhaps I can simply use some sort of time function to wait 2 min the use winclose()

Share this post


Link to post
Share on other sites
automagician

You shouldn't have to wait 2 minutes, one of the above methods should work. Typically it's not good automation practice to use a wait statement in this case, becasue if the popup comes up in 20secs, you are wasting 1m 40s of time.... :)

Did you try using text that is specific to the popup window? I believe you will still run into the same problem using the suggestions from Slim, because the main window has the same title....right Slim?

Slim, Did you see the post about the popup having the same window title as the main window? Won't this cause the same problem if sent too early?

Edited by automagician

Share this post


Link to post
Share on other sites
MHz

WinWait('iScope', 'Selected Tasks Finished')
WinClose('iScope', 'Selected Tasks Finished')

WinWait should pause the script, til it arrives.

Edit: It has different text, right?

Edited by MHz

Share this post


Link to post
Share on other sites
mattfaust

the popup itself has "selected tasks finished"

and a button that says "close"

when i use

WinWait('iScope v2.24.3', 'Selected Tasks Finished')

WinClose('iScope v2.24.3', 'Selected Tasks Finished')

the program closes too early.

I cant find "Selected Tasks Finished" anywhere else on the previos screens.

cant I identify this popup by:

Control ID: 1001

ClassNameNN: MDIdialogCL293840241

Share this post


Link to post
Share on other sites
MHz

Opt("WinSearchChildren", 1)
WinWait('iScope', 'Selected Tasks Finished')
ControlClick('iScope', 'Selected Tasks Finished', 'Button1')

Another similar option. Try this.

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  

×