Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Restart a scipt?

$
0
0

Hey folks,

 

Ive a script that opens and loads a file and runs some tests on it.

 

Now if everything runs correctly and the last test of the 1st file. The script will automatically run again for other files of the .XML extension.

 

However if I get a problem with one file is there a way for me to jump to the end of the file test or instead run the tests on the next file?

 

Thanks :)

 

Below is code for a small script that loads the file into my program. However if you see the else statement instead of exit I want to be able to then run the script all over again except for the next .XML file.

 

AutoIt         
  #include-once #include <C:\Documents and Settings\User\Desktop\Library\Error_log.au3> Func LoadfileWB($MainWindowClassName, $ExternalTitle, $MsgSvrclass, $FilePath)     WinWaitActive("[CLASS:" & $MainWindowClassName & "]")     WinSetState("[CLASS:" & $MsgSvrclass & "]", "", @SW_MINIMIZE)     ControlClick("[CLASS:" & $MainWindowClassName & "]", "", "TButton1")     Sleep(500)     ControlCommand("[TITLE:" & $ExternalTitle & "]", "", "ToolbarWindow322", "SendCommandID", "41061")     Sleep(500)     If (ControlSend("[TITLE:" & $ExternalTitle & "]", "", "Edit1", $FilePath)) Then         If (ControlGetText ( "[TITLE:Open; ]", $FilePath, 1148 )) Then             ControlClick("[TITLE:" & $ExternalTitle & "]", "&Open", "Button2", "left", 1)             Sleep(500)             Return True         Else             ACRAOutputError("Function not entered correctly via keyboard.")             Exit         EndIf     Else         Sleep(2000)         ControlCommand("[TITLE:" & $ExternalTitle & "]", "OK", "[CLASS:Button; INSTANCE:1;ID:2 ]", "Check", "")         ACRAOutputError("Function timed out while trying to load the file!")         Exit     EndIf     Return False EndFunc  

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>