anyday Posted March 24, 2006 Share Posted March 24, 2006 guys sorry to bug yall so much with the easy stuff. I got a simple question here is an example of what i need to know $oIE = _IECreate() _IENavigate($oIE, "https://website.com") _IEPopUps() $title = WinGetTitle("", "") The question i have is, when the script loads the webpage to the site im working with some peoples computer's have iexplorer set to different security level's so sometimes windows will ask if its ok before proceding due to some activex stuff on the site. well i have a _IEPopUps() Function that checks for all sorts of different "windows" that could pop up. that part works fine, it will goto the function and check for all the different windows but it wont come back to the script and resume where it left off @ the next line $title = WinGetTitle(). Here is the code for the function Func _IEPopUps() Sleep( 3000 ) While 1 $windowtitle = WinGetTitle("", "") Select Case $windowtitle = "Security Alert" WinActivate("Security Alert", "") ControlClick("Security Alert", "", "Button1") Case $windowtitle = "Choose a digital certificate" WinActivate("Choose a digital certificate", "") ControlClick("Choose a digital certificate", "", "Button3") EndSelect WEnd EndFunc any help i would be greatful. Link to comment Share on other sites More sharing options...
billmez Posted March 24, 2006 Share Posted March 24, 2006 guys sorry to bug yall so much with the easy stuff. I got a simple question here is an example of what i need to know $oIE = _IECreate() _IENavigate($oIE, "https://website.com") _IEPopUps() $title = WinGetTitle("", "") The question i have is, when the script loads the webpage to the site im working with some peoples computer's have iexplorer set to different security level's so sometimes windows will ask if its ok before proceding due to some activex stuff on the site. well i have a _IEPopUps() Function that checks for all sorts of different "windows" that could pop up. that part works fine, it will goto the function and check for all the different windows but it wont come back to the script and resume where it left off @ the next line $title = WinGetTitle(). Here is the code for the function Func _IEPopUps() Sleep( 3000 ) While 1 $windowtitle = WinGetTitle("", "") Select Case $windowtitle = "Security Alert" WinActivate("Security Alert", "") ControlClick("Security Alert", "", "Button1") Case $windowtitle = "Choose a digital certificate" WinActivate("Choose a digital certificate", "") ControlClick("Choose a digital certificate", "", "Button3") EndSelect WEnd EndFunc any help i would be greatful. I would guess that the popups are taking the focus away from the IE window. Try using a WinActivate on your IE window when you return from _IEPopUps before you try to continue with anything else. Link to comment Share on other sites More sharing options...
Nuffilein805 Posted March 24, 2006 Share Posted March 24, 2006 you'll never get out of that loop unless you define it like: ;1. Func _IEPopUps() Sleep( 3000 ) While 1 $windowtitle = WinGetTitle("", "") Select Case $windowtitle = "Security Alert" WinActivate("Security Alert", "") ControlClick("Security Alert", "", "Button1") Case $windowtitle = "Choose a digital certificate" WinActivate("Choose a digital certificate", "") ControlClick("Choose a digital certificate", "", "Button3") Case $windowtitle = "your title"; <---- ExitLoop ; <------ EndSelect WEnd EndFunc ;or 2. Func _IEPopUps() Sleep( 3000 ) $tim = timerinit() While 1 $windowtitle = WinGetTitle("", "") Select Case $windowtitle = "Security Alert" WinActivate("Security Alert", "") ControlClick("Security Alert", "", "Button1") Case $windowtitle = "Choose a digital certificate" WinActivate("Choose a digital certificate", "") ControlClick("Choose a digital certificate", "", "Button3") EndSelect if timerdiff($tim) > 5000 then exitloop; <----- set the delay to whatever you need WEnd EndFunc my little chatmy little encryption toolmy little hidermy unsafe clickbot 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