Sign in to follow this  
Followers 0
kzar

Handling if a window MAYBE comes up

7 posts in this topic

I am writing a script that opens a PDF at one stage. If Acrobat reader has not already been used on the PC it makes you press accept to the EULA but obviously if you have already accepted the agreement you don't have to again.

I know how to accept the EULA but I'm not sure how to handle both situations. I did try waiting for the EULA window for 10 seconds but on slow computers that isn't enough time and if the EULA isn't going to show up it wastes time and slows down the script.

How would you do this? Thanks

Share this post


Link to post
Share on other sites



If WinExists() Then ?

maybe...


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites

I could never figure out how to do that either... It'd be a cool feature to add into Autoit.

What I had to end up doing was using the Coroutine UDF here in the forums, create a seperate Autoit instance that waits for the seperate window. Then if one found one before the other, it'd close the other instance then continue.

Share this post


Link to post
Share on other sites

I think you can just set the EULA as read:

RegWrite("HKCU\Software\Adobe\Acrobat Reader\6.0\AdobeViewer","REG_DWORD","EULA","1")

RegWrite("HKCU\Software\Adobe\Acrobat Reader\7.0\AdobeViewer","REG_DWORD","EULA","1")

Or something like that. I haven't tested this, but I think it's a good theory. :whistle:


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

I am writing a script that opens a PDF at one stage. If Acrobat reader has not already been used on the PC it makes you press accept to the EULA but obviously if you have already accepted the agreement you don't have to again.

I know how to accept the EULA but I'm not sure how to handle both situations. I did try waiting for the EULA window for 10 seconds but on slow computers that isn't enough time and if the EULA isn't going to show up it wastes time and slows down the script.

How would you do this? Thanks

use an adlib function, and wait for each window with winwait() or pixelchecksum() verification of window before continuing. that way you won't have to worry about code executing early, and you'll have the code to handle the odd window IF it shows up.


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

^^ That's kinda what I said. Search the forums for coroutine or adlib.

Share this post


Link to post
Share on other sites

AdlibEnable() is in the help file index. It will will handle the task easily by using WinExist() to check for your window.

:whistle:

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