mattfaust Posted March 21, 2005 Share Posted March 21, 2005 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 Link to comment Share on other sites More sharing options...
automagician Posted March 21, 2005 Share Posted March 21, 2005 (edited) 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 March 21, 2005 by automagician Link to comment Share on other sites More sharing options...
mattfaust Posted March 21, 2005 Author Share Posted March 21, 2005 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? Link to comment Share on other sites More sharing options...
MHz Posted March 21, 2005 Share Posted March 21, 2005 Why not use WinClose() ? Link to comment Share on other sites More sharing options...
automagician Posted March 21, 2005 Share Posted March 21, 2005 (edited) 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 March 21, 2005 by automagician Link to comment Share on other sites More sharing options...
SlimShady Posted March 21, 2005 Share Posted March 21, 2005 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") Link to comment Share on other sites More sharing options...
mattfaust Posted March 21, 2005 Author Share Posted March 21, 2005 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() Link to comment Share on other sites More sharing options...
automagician Posted March 21, 2005 Share Posted March 21, 2005 (edited) 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 March 21, 2005 by automagician Link to comment Share on other sites More sharing options...
MHz Posted March 21, 2005 Share Posted March 21, 2005 (edited) 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 March 21, 2005 by MHz Link to comment Share on other sites More sharing options...
mattfaust Posted March 21, 2005 Author Share Posted March 21, 2005 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 Link to comment Share on other sites More sharing options...
MHz Posted March 21, 2005 Share Posted March 21, 2005 Opt("WinSearchChildren", 1) WinWait('iScope', 'Selected Tasks Finished') ControlClick('iScope', 'Selected Tasks Finished', 'Button1') Another similar option. Try this. 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