AutoIt script hangs for no apparent reason

0

I am stuck with this script. For ages it didn't work. And then suddenly it did...and now...on a reinstall...it doesn't work again. It stops on the first winwaitactive line. The folder is most certainly correct.

    #include <File.au3>
    #include <Array.au3>

    AutoItSetOption ("WinTitleMatchMode", 1)
    AutoItSetOption ("WinTextMatchMode", 2)
    AutoItSetOption ("TrayIconDebug", 1)

    $folder = "F:\MUSIC SOFTWARE\BIAB\TRACKS\REALTRACKS\"

    Local $files = _FileListToArray($folder, "*")

    For $i = 1 to UBound($files)
        install($files[$i])
    Next

    Func install($file)
       $pid = Run($file)
       WinWaitActive("Setup - RealTracks", "Welcome to the RealTracks")
       Send("!n")
       WinWait("Setup - RealTracks", "Please read")
       Send("!a")
       Send("!n")
       WinWait("Setup - RealTracks", "When you are ready")
       Send("!n")
       WinWait("Setup - RealTracks", "Where should")
       Send("!n")
       WinWait("Setup - RealTracks", "Setup is now ready")
       Send("!i")
       WinWait("Setup - RealTracks", "Completing")
       Send("!f")
       ProcessWaitClose($pid)
    EndFunc

user3261239

Posted 2014-06-21T10:18:40.933

Reputation: 1

Quite an obvious solution...

Just needed to add the $folder

install($folder&$files[$i])
 – user3261239  – 2014-06-21T13:26:23.857

Answers

0

Looking over your script, there's no declaration for the $File variable. Also, you're using wintitlematchmode, 2 so you don't need to be so explicit in your window notation. Instead of Setup - RealTracks try just RealTracks.

Colyn1337

Posted 2014-06-21T10:18:40.933

Reputation: 1 191