Sign in to follow this  
Followers 0
DominicChan

How to do a if then statement in AutoIT

4 posts in this topic

Our internal web traffic go through a websense filter. When you go out to an external site, if ask have a pop-up windows and ask you for a user name and passowrd. The problem is that, there is a time out, thus it ask when I try to run the script sometime, and it may not. How do I do a if/then statement in autoIT for a pop-up windows detection after I enter a website url?

i.e. after i enter www.msn.com and {enter}, if (and only if) it detection a pop-windows with a window title (let say log-on), enter the username and password and enter. If not, don't worry about it

dwc

Share this post


Link to post
Share on other sites



Our internal web traffic go through a websense filter. When you go out to an external site, if ask have a pop-up windows and ask you for a user name and passowrd. The problem is that, there is a time out, thus it ask when I try to run the script sometime, and it may not. How do I do a if/then statement in autoIT for a pop-up windows detection after I enter a website url?

i.e. after i enter www.msn.com and {enter}, if (and only if) it detection a pop-windows with a window title (let say log-on), enter the username and password and enter. If not, don't worry about it

dwc

psudocode

go to website
if winexists("window name") <> 0 then
do code here
endif

[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

Share this post


Link to post
Share on other sites

Our internal web traffic go through a websense filter. When you go out to an external site, if ask have a pop-up windows and ask you for a user name and passowrd. The problem is that, there is a time out, thus it ask when I try to run the script sometime, and it may not. How do I do a if/then statement in autoIT for a pop-up windows detection after I enter a website url?

i.e. after i enter www.msn.com and {enter}, if (and only if) it detection a pop-windows with a window title (let say log-on), enter the username and password and enter. If not, don't worry about it

dwc

By default, the _IECreate() and _IENavigate() functions will wait for the page to complete before allowing the script to continue. This prevents the script from starting the page and then running a loop to watch for or handle a popup.

The way to handle it is use the $f_wait = 0 parameter (see the functions in the help file). This will cause the initial navigation to occur but will not wait for it to complete, allowing you to handle what happens next with the script. Like a loop that watches for a popup until the page completes (detected with _IELoadWait()).

:)


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

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