Jump to content

Handling if a window MAYBE comes up


kzar
 Share

Recommended Posts

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

Link to comment
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]

Link to comment
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.

Link to comment
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]

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...