Example() Func Example() ; Run to upload ;Run("notepad.exe") ; Wait 10 seconds for the Notepad window to appear. Local $hWnd = WinWait("[CLASS:#32770]", "", 10) ; Activate the Notepad window using the handle returned by WinWait. WinActivate($hWnd) ControlFocus($hWnd,"","Edit1") Sleep(2000) ControlSetText($hWnd, "", "Edit1", "D:\MDMWSPCE\COLT_Sanity\TestData\QT-20180823-042882-01.pdf") Sleep(2000) ControlClick($hWnd, "","Button1"); Sleep(3000) ; Close the Notepad window using the handle returned by WinWait. WinClose($hWnd) EndFunc ;==>Example