Скрипт AutoIt зависает без видимой причины

821
user3261239

Я застрял с этим сценарием. Веками это не сработало. А потом вдруг это произошло ... и теперь ... при переустановке ... это снова не работает. Останавливается на первой строке winwaitactive. Папка, безусловно, правильная.

 #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 
0
Совершенно очевидное решение ... Просто нужно было добавить $ folder install ($ folder & $ files [$ i]) user3261239 9 лет назад 0

1 ответ на вопрос

0
Colyn1337

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.