Sign in to follow this  
Followers 0
narayanjr

WinWait()

4 posts in this topic

WinWait("Security Information","",5)
If WinExists("Security Information") Then
    Send("{ALTDOWN}y{ALTUP}")
EndIf

I need it to wait for the window "Security Information" which asks if you want to display secure and non secure information on the web page. Then if it finds it send Alt + Y to say yes, or if its not found within 5 seconds just continue on. When I use this as a separate program and I go to the site it works but when I have AuotIt go to the site it just waits the 5 seconds and continues the script.

*Note* "https://ssl.rapidshare.com/cgi-bin/collectorszone.cgi" that page itself does not get the "security Information" window its once you log in that it opens up. Any ideas?

#include <IE.au3> 
$oIE = _IECreate("https://ssl.rapidshare.com/cgi-bin/collectorszone.cgi")
WinWait("Security Information","",5)
If WinExists("Security Information") Then
    Send("{ALTDOWN}y{ALTUP}")
EndIf

$oForm = _IEFormGetCollection ($oIE, 0)
$oQuery = _IEFormElementGetCollection ($oForm, 0)
$oQuery2 = _IEFormElementGetCollection ($oForm, 1)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

WinWait("Security Information","",5)
If WinExists("Security Information") Then
    Send("{ALTDOWN}y{ALTUP}")
EndIf

I need it to wait for the window "Security Information" which asks if you want to display secure and non secure information on the web page. Then if it finds it send Alt + Y to say yes, or if its not found within 5 seconds just continue on. When I use this as a separate program and I go to the site it works but when I have AuotIt go to the site it just waits the 5 seconds and continues the script.

*Note* "https://ssl.rapidshare.com/cgi-bin/collectorszone.cgi" that page itself does not get the "security Information" window its once you log in that it opens up. Any ideas?

Just put in an adlib to watch for it:

AdlibEnable("_SecInfoCheck", 250)

; Rest of the script

Func _SecInfoCheck()
    If WinExists("Security Information") Then
        Do 
            WinActivate("Security Information")
        Until WinActive("Security Information")
        Send("!y")
    EndIf
EndFunc   ;==>_SecInfoCheck

:rolleyes:

Edit: Tweaked per MHz.

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Thank You,

that worked perfectly. I've never seen that before I am going to look into it more Thanks.

Share this post


Link to post
Share on other sites

Also, I highly recommend using WinWaitActive() before using Send(). Send requires the window to be active so do not assume that the window is active (even after using WinActivate) else something bad may happen instead.

:rolleyes:

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