Mike68 0 Posted November 16, 2010 I have a script that I want to run that selects the importing of a cert into Firefox, but also want to check the pop-up if the cert is already installed. This works but as soon as I Add the IF, THEN statements it does nothing. Please Help. Dim $PID1 Opt("WinWaitDelay",100) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) $URL="http://SomeURL/mcafee_webgateway.der" Run(@COMSPEC & " /c start /min firefox.exe "& $URL) If _WinWaitActivate("Downloading Certificate","")Then MouseMove(27,96) MouseDown("left") MouseMove(27,97) MouseUp("left") MouseClick("left",26,114,1) MouseClick("left",26,138,1) MouseMove(380,257) MouseDown("left") MouseMove(381,257) MouseUp("left") Else Exit _WinWaitActivate("Alert","") MouseClick("left",181,81,1) EndIF Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc sleep (1000) $PID1 = ProcessExists("firefox.exe") ; Will return the PID or 0 if the process isn't found. ProcessClose($PID1) Share this post Link to post Share on other sites
rudi 33 Posted November 27, 2010 Hi. Welcome to the forum Where is the issue with your script? use SciTE Editor to "tidy" your script for better readability: Dim $PID1 Opt("WinWaitDelay", 100) Opt("WinDetectHiddenText", 1) Opt("MouseCoordMode", 0) $URL = "http://SomeURL/mcafee_webgateway.der" Run(@ComSpec & " /c start /min firefox.exe " & $URL) While 1 If _WinWaitActivate("Downloading Certificate", "") Then MouseMove(27, 96) MouseDown("left") MouseMove(27, 97) MouseUp("left") MouseClick("left", 26, 114, 1) MouseClick("left", 26, 138, 1) MouseMove(380, 257) MouseDown("left") MouseMove(381, 257) MouseUp("left") Else Exit _WinWaitActivate("Alert", "") MouseClick("left", 181, 81, 1) EndIf WEnd Func _WinWaitActivate($title, $text, $timeout = 0) WinWait($title, $text, $timeout) If Not WinActive($title, $text) Then WinActivate($title, $text) WinWaitActive($title, $text, $timeout) EndFunc ;==>_WinWaitActivate Sleep(1000) $PID1 = ProcessExists("firefox.exe") ; Will return the PID or 0 if the process isn't found. ProcessClose($PID1) Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Share this post Link to post Share on other sites