Sign in to follow this  
Followers 0
anyday

Some Basic Help For A Noob

3 posts in this topic

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.

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0