Sign in to follow this  
Followers 0
CemalSenturk

using sleep between functions

5 posts in this topic

_RunAU3("skalistir.au3")
Sleep(10000)
_RunAU3("spastrakuc.au3")
_RunAU3("spastrabuy.au3")
_RunAU3("spastraele.au3")

 Func _RunAU3($sFilePath, $sWorkingDir = "", $iShowFlag = @SW_SHOW, $iOptFlag = 0)
    Return Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '"', $sWorkingDir, $iShowFlag, $iOptFlag)
 EndFunc

Here is my code and I tried to use sleep between each _RunAU3 line but causes error openning file. And also tried with:

_RunAU3("skalistir.au3")
_RunAU3("spastrakuc.au3")
_RunAU3("spastrabuy.au3")
_RunAU3("spastraele.au3")

 Func _RunAU3($sFilePath, $sWorkingDir = "", $iShowFlag = @SW_SHOW, $iOptFlag = 0)
    Return Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '"', $sWorkingDir, $iShowFlag, $iOptFlag)
    Sleep(10000)
 EndFunc

But cannot make it work :)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Are the scripts in the same dir as you current @scriptDir?

What's the failure.

I'd suggest adding a ConsoleWrite of your run command, prior to execution...that way, you can grab the command, and execute it in a CMD prompt, to see the exact failure reason.

Also, because your Return dirctly following the Run, the Sleep will never occur...have the run() return to a variable, and return that variable after the sleep.

$iReturn = Run(...)
Sleep(1000)
Return $iReturn
Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

C:Program Files (x86)AutoIt3Include

here is the all .au3 scripts that I use, at the same directory.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Run this, and provide the output...also, do you know about runwait()?  That waits for your script to complete.

ConsoleWrite(@ScriptDir & @CRLF)
_RunAU3("skalistir.au3")
_RunAU3("spastrakuc.au3")
_RunAU3("spastrabuy.au3")
_RunAU3("spastraele.au3")

Func _RunAU3($sFilePath, $sWorkingDir = "", $iShowFlag = @SW_SHOW, $iOptFlag = 0)
    ConsoleWrite(FileExists($sFilePath) & @TAB & '"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '"' & @CRLF)
    $iReturn = Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '"', $sWorkingDir, $iShowFlag, $iOptFlag)
    Sleep(10000)
    Return $iReturn
EndFunc
Edited by jdelaney
1 person likes this

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Nevermind. I solved the problem thanks btw :)

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  
Followers 0