#include #include #RequireAdmin Global $sPath = "\\10.174.10.9\SPOON\TMGAD0001\INPUT\" Global $tLocal = _Date_Time_SystemTimeToTzSpecificLocalTime(_Date_Time_GetSystemTime()) Global $sFileName1 = "FR_IP_79_" & _WinAPI_GetDateFormat(0, $tLocal, 0, 'yyyyMMdd') & _WinAPI_GetTimeFormat(0, $tLocal, $TIME_FORCE24HOURFORMAT, 'HHmm') Global $sFileName2 = "FR_IP_82_" & _WinAPI_GetDateFormat(0, $tLocal, 0, 'yyyyMMdd') & _WinAPI_GetTimeFormat(0, $tLocal, $TIME_FORCE24HOURFORMAT, 'HHmm') Global $sFileName3 = "FR_IP_47_" & _WinAPI_GetDateFormat(0, $tLocal, 0, 'yyyyMMdd') & _WinAPI_GetTimeFormat(0, $tLocal, $TIME_FORCE24HOURFORMAT, 'HHmm') Global $sFileName4 = "FR_IP_49_" & _WinAPI_GetDateFormat(0, $tLocal, 0, 'yyyyMMdd') & _WinAPI_GetTimeFormat(0, $tLocal, $TIME_FORCE24HOURFORMAT, 'HHmm') Global $sWindow1 = "[TITLE:" & $sFileName1 & ".xlsx - Excel; CLASS:XLMAIN]" Global $sWindow2 = "[TITLE:" & $sFileName2 & ".xlsx - Excel; CLASS:XLMAIN]" Global $sWindow3 = "[TITLE:" & $sFileName3 & ".xlsx - Excel; CLASS:XLMAIN]" Global $sWindow4 = "[TITLE:" & $sFileName4 & ".xlsx - Excel; CLASS:XLMAIN]" run("E:\sVMS2000\sVMS2000.exe") Local $hWnd = WinWait("[TITLE:Login; CLASS:Qt5QWindowIcon]", "") Sleep(1000) ; Click "Login" ControlClick( "Login", "", $hWnd ,"left", 1, 277, 490 ) Local $hWnd = WinWait("[TITLE:sVMS2000; CLASS:Qt5QWindowIcon]", "") $WinPos = WinGetPos($hWnd) Sleep(1000) ; *************************************************************** ; Perform Face Recognition Device 10.174.120.79 (Terminal A) ; *************************************************************** ; Click "Face Manage" ControlClick( "sVMS2000", "", $hWnd, "left", 1, 667, 195 ) Sleep(1000) ; Click "Default Group" ControlClick( "sVMS2000", "", $hWnd, "left", 2, 37, 119 ) Sleep(1000) ; Click 10.174.10.79 "Terminal A" Device ControlClick( "sVMS2000", "", $hWnd, "left", 1, 80, 141 ) Sleep(1000) ; Click "Search" ControlClick( "sVMS2000", "", $hWnd, "left", 1, 1455, 145 ) Sleep(10000) If WinActive ("MessBox") Then ; Close the Excel file. WinClose("MessBox") Sleep(500) ; Activate the sVMS2000 window. Local $hWnd = WinWait("[TITLE:sVMS2000; CLASS:Qt5QWindowIcon]", "") ; Uncheck "Export Picture" ControlClick( "sVMS2000", "", $hWnd, "left", 1, 245, 838 ) Sleep(1000) Else ; Uncheck "Export Picture" ;ControlClick( "sVMS2000", "", $hWnd, "left", 1, 245, 838 ) ;Sleep(1000) ; Click "Export" ControlClick( "sVMS2000", "", $hWnd, "left", 1, 1530, 145 ) Sleep(2000) ; Wait for Explorer Window Local $hWnd1 = WinWait("[TITLE:Save; CLASS:#32770]", "") ; Click on the text box ControlClick ( $hWnd1, "", 1001 ) Sleep(10000) ; Enter file saved name. ControlSetText( $hWnd1, "", 1001, $sPath & $sFileName1 ) Sleep(10000) ; Click SAVE ControlClick ( $hWnd1, "", 1 ) Sleep(10000) ; Wait for the Excel File to Appear WinWait($sWindow1, "") Sleep(2000) ; Close the Excel file. WinClose($sWindow1, "") Sleep(500) EndIf ; *************************************************************** ; Perform Face Recognition Device 10.174.120.82 (Terminal B) ; *************************************************************** ; Activate the sVMS2000 window. Local $hWnd = WinWait("[TITLE:sVMS2000; CLASS:Qt5QWindowIcon]", "") ; Click 10.174.10.82 "Terminal B" Device ControlClick( "sVMS2000", "", $hWnd, "left", 1, 80, 162 ) Sleep(1000) ; Click "Search" ControlClick( "sVMS2000", "", $hWnd, "left", 1, 1455, 145 ) Sleep(10000) If WinActive ("MessBox") Then ; Close the error box. WinClose("MessBox") Sleep(500) Else ; Click "Export" ControlClick( "sVMS2000", "", $hWnd, "left", 1, 1530, 145 ) Sleep(2000) ; Wait for Explorer Window Local $hWnd1 = WinWait("[TITLE:Save; CLASS:#32770]", "") ; Click on the text box ControlClick ( $hWnd1, "", 1001 ) Sleep(10000) ; Enter file saved name. ControlSetText( $hWnd1, "", 1001, $sPath & $sFileName2 ) Sleep(10000) ; Click SAVE ControlClick ( $hWnd1, "", 1 ) Sleep(60000) ; Wait for the Excel File to Appear. WinWait($sWindow2, "") Sleep(2000) ; Close the Excel file. WinClose($sWindow2, "") Sleep(500) EndIf Sleep(500) ; *************************************************************** ; Perform Face Recognition Device 10.174.120.47 (Terminal C) ; *************************************************************** ; Activate the sVMS2000 window. Local $hWnd = WinWait("[TITLE:sVMS2000; CLASS:Qt5QWindowIcon]", "") ; Click 10.174.10.47 "Terminal C" Device ControlClick( "sVMS2000", "", $hWnd, "left", 1, 80, 183 ) Sleep(1000) ; Click "Search" ControlClick( "sVMS2000", "", $hWnd, "left", 1, 1455, 145 ) Sleep(60000) If WinActive ("MessBox") Then ; Close the error box WinClose("MessBox") Sleep(500) ;WinWaitClose("MessBox") ; Wait until the window is closed ;ProcessWaitClose("") ; Wait until the window is closed via Process Close ;MsgBox(0, "MessBox", "MessBox has been closed", 5) ;ElseIf WinExists("MessBox") = "0" Then ;ElseIf ProcessExists("") = "0" Then ;MsgBox(0, "MessBox", "That window doesn't exist!", 5) Else ; Click "Export" ControlClick( "sVMS2000", "", $hWnd, "left", 1, 1530, 145 ) Sleep(2000) ; Wait for Explorer Window Local $hWnd1 = WinWait("[TITLE:Save; CLASS:#32770]", "") ; Click on the text box ControlClick ( $hWnd1, "", 1001 ) Sleep(10000) ; Enter file saved name. ControlSetText( $hWnd1, "", 1001, $sPath & $sFileName3 ) Sleep(10000) ; Click SAVE ControlClick ( $hWnd1, "", 1 ) Sleep(60000) ; Wait for the Excel File to Appear. WinWait($sWindow3, "") Sleep(2000) ; Close the Excel file. WinClose($sWindow3, "") Sleep(500) EndIf Sleep(500) ; *************************************************************** ; Perform Face Recognition Device 10.174.120.49 (Terminal D) ; *************************************************************** ; Activate the sVMS2000 window. Local $hWnd = WinWait("[TITLE:sVMS2000; CLASS:Qt5QWindowIcon]", "") ; Click 10.174.10.49 "Terminal D" Device ControlClick( "sVMS2000", "", $hWnd, "left", 1, 80, 204 ) Sleep(1000) ; Click "Search" ControlClick( "sVMS2000", "", $hWnd, "left", 1, 1455, 145 ) Sleep(60000) If WinActive ("MessBox") Then ; Close the error box. WinClose("MessBox") Sleep(500) ;WinWaitClose("MessBox") ; Wait until the window is closed ;ProcessWaitClose("") ; Wait until the window is closed via Process Close ;MsgBox(0, "MessBox", "MessBox has been closed", 5) ;ElseIf WinExists("MessBox") = "0" Then ;ElseIf ProcessExists("") = "0" Then ;MsgBox(0, "MessBox", "That window doesn't exist!", 5) Else ; Click "Export" ControlClick( "sVMS2000", "", $hWnd, "left", 1, 1530, 145 ) Sleep(2000) ; Wait for Explorer Window Local $hWnd1 = WinWait("[TITLE:Save; CLASS:#32770]", "") ; Click on the text box ControlClick ( $hWnd1, "", 1001 ) Sleep(10000) ; Enter file saved name. ControlSetText( $hWnd1, "", 1001, $sPath & $sFileName4 ) Sleep(10000) ; Click SAVE ControlClick ( $hWnd1, "", 1 ) Sleep(60000) ; Wait for the Excel File to Appear. WinWait($sWindow4, "") Sleep(2000) ; Close the Excel file. WinClose($sWindow4, "") Sleep(500) EndIf Sleep(500) ; *************************************************************** ; Close/Exit the sVMS2000 Application. ; *************************************************************** ; Activate the sVMS2000 window. Local $hWnd = WinWait("[TITLE:sVMS2000; CLASS:Qt5QWindowIcon]", "") ; Click EXIT. ControlClick( "sVMS2000", "", $hWnd, "left", 1, 1580, 20 ) ; Wait for the Exit Confirmation window. Local $hWnd1 = WinWait("[TITLE:MessBox; CLASS:Qt5QWindowIcon]", "") ; Confirm to exit. ControlClick( "sVMS2000", "", $hWnd1, "left", 1, 370, 210 ) exit 0