copyleft Posted September 27, 2022 Share Posted September 27, 2022 (edited) I cobbled this script from the "WinExists" example in the AutoIt help file. It works fine except if I dismiss the "Window exists" msgbox or leave that "Window exists" command in line 10 out of my script altogether, the browser window closes. I want to perform several file and directory commands and run a program after I manually close the browser normally, without having to dismiss the small Autoit message box. $SetupDir= "D:\Chrome\data" $webfile = "file:///C:/Bin/0HOME.HTM" Chrome() Func Chrome() ; Run Chrome ShellExecute("D:\Chrome\chromium-portable.exe", $webfile) ; Wait 3 seconds for Chrome. WinWait("[CLASS:Chrome_WidgetWin_1]", "", 3) ; Test if Chrome opens and display the results. If WinExists("[CLASS:Chrome_WidgetWin_1]") Then MsgBox($MB_SYSTEMMODAL, "", "Chrome exists") Else Sleep(300); to lower CPU usage less FileDelete($SetupDir & "\Default\Preferences") EndIf EndFunc Exit Edited September 29, 2022 by copyleft Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now