Jump to content
Sign in to follow this  

Next and Retry Button For Loop

Recommended Posts


I have a script that reads numbers from a file and puts it in a textbox and does a search.  If the script doesn't find a match I would like to be able to have a next button so it will go to the next line of the file.  I would also like a retry button just in case the script would mess up and need to go back and retry the search again.  I have the my current code below.  I'm just not sure where to even start with getting this to work. 

#include <Array.au3>
#include <File.au3>
#include <IE.au3>
msgbox(0,"Get Ready...","After you press OK here this script is going to start working.  Make sure you have everything open and ready.")
WinWaitActive("xxxxxxxx - Internet Explorer", "")
Global $Paused
HotKeySet("{ESC}", "TogglePause")
$counter = 0
Local $aInput
$file = "C:\test.txt"
_FileReadToArray($file, $aInput)
For $i = 1 to UBound($aInput) -1
   $counter = FileReadLine($file, $i)
   ControlSend("xxxxxxxx - Internet Explorer", "", "[CLASS:Internet Explorer_Server]", "{TAB 4}")
   ControlSetText("xxxxxxx - Internet Explorer", "", "[CLASS:Edit; INSTANCE:2]", "Result can't be found") ; searches for Result can't be found
Until WinActive("", "1 match") ;After match is found we can go to the next line

While 1

Func TogglePause()
  $Paused = NOT $Paused
  While $Paused
    ToolTip('Script is "Paused"',0,0)

Share this post

Link to post
Share on other sites

Try to make a GUI with Koda Form Designer. It will give you an easy way to develop a GUI for your application. I think having a look at that will help.

Share this post

Link to post
Share on other sites

I will take a look at that.


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.