thertel Posted February 17, 2009 Share Posted February 17, 2009 Okay, I am writing a script that needs to wait for a scan to complete before it can click a button "Next >" to continue on to the next page. I am completely stumped. I've tried a few different loops to no avail. The other issue is that what the button ID is the same for the cancel button that is present during the scan as the next buttons ID after the scan, which is what has stumped me. any advice would be great. Thanks, Thomas Link to comment Share on other sites More sharing options...
Manjish Posted February 17, 2009 Share Posted February 17, 2009 Thomas, Can u tell me what application's button u have to check.. if u can pls provide the download link.. so that i can test it out.. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
bo8ster Posted February 17, 2009 Share Posted February 17, 2009 Don't use the ID. Use the TEXT to differentiate the two buttons then wait till the next button becomes enabled. Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
cmattb Posted February 17, 2009 Share Posted February 17, 2009 I usually use winwait("title","text") For that. Theres usually text saying that the scan is complete that you can use. So the full code would be: winwait("title","text") winactivate("title","text");I know this is redunt when using controlclick, but I still do it out of habit controlclick("title","text","[TEXT: Next >]") Link to comment Share on other sites More sharing options...
BrettF Posted February 17, 2009 Share Posted February 17, 2009 (edited) Check out this quick example: #include <GUIConstantsEx.au3> $GUI = GUICreate ("", 200, 90) $button1 = GUICtrlCreateButton ("Button 1", 20, 10, 160, 33) GUICtrlSetState ($button1, $GUI_DISABLE) $button2 = GUICtrlCreateButton ("Button 2", 20, 50, 160, 33) GUISetState () $timer = TimerInit () $timerd = True While 1 ToolTip ("Button 1 State = " & ControlCommand ($GUI, "", "[CLASS:Button; INSTANCE:1]", "IsEnabled", "")) $nMsg = GUIGetMsg () Select Case $nMsg = -3 Exit Case TimerDiff ($timer) >= 5000; Wait 5 seconds If $timerd Then GUICtrlSetState ($button1, $GUI_ENABLE) $timerd = False EndIf EndSelect WEnd Use the AutoIt Window Info tool to get the class/instance part. Cheers, Brett Edited February 17, 2009 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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