I have 2 scripts which must be run one after the other since the second script gets a value due to the action of first script, the second script must not start till the first is complete. Can I combine the 2 scripts so second does not start till first is complete
;;;;Script 1
#include <MsgBoxConstants.au3>
WinActivate("Application")
WinWaitActive("Application")
Send("S*L/USER01/16AUG/US")
Sleep(2000)
Send("{ENTER}")
Sleep(3000)
Send("MB")
Sleep(3000)
Send("{ENTER}")
Sleep(4000)
;;;;;;End Script 1
;;;;;;Script 2
#include <MsgBoxConstants.au3>
$file = @ScriptDir & "\T.log"
$iNum = StringRegExp(FileRead($file), "(?sm).*^\h*(\d{1,3})", 1)[0]
ConsoleWrite($iNum & @CRLF)
WinActivate("Application")
Local $hWnd = WinWaitActive("Application", "", 5)
If $hWnd Then
For $i = 1 To $iNum
Send("SEQUENCE" & $i & "{ENTER}")
Sleep(2000)
Next
Else
MsgBox(0, "", '"Application" window not found.')
EndIf
;;;;;;;;;End Script 2