Sign in to follow this  
Followers 0
uptimeinf

simplest WinWaitActive-send ENTER problem

7 posts in this topic

I've been scripting the install of a lot of my progs lately, and this keeps coming up. This time it was with Far Cry.

I tried searching autoit bug forum with "bugs WinWaitActive" but either there's nothing there or search is useless.

And I have no time to scan through over 1200 bug reports.

I step through this with no problem in Scite:

WinWaitActive ( "Far Cry - InstallShield Wizard" )

Send ( "{ENTER}" )

[ Simple huh? ]

But, when I compile and run it, the ENTER is never acted on--EVEN IF I CLICK THE WINDOW!

Worse, is that it happens a lot, and I never know when it will do it. Ya think your script works

and then ya get the big, screeching halt.

Why is this happening? Again, I know the window has focus.

I'm copying the window name right out of autoit info tool.

It is not an unknown window.

Frustrated Scripting (not so Newb)

Share this post


Link to post
Share on other sites



I've been scripting the install of a lot of my progs lately, and this keeps coming up. This time it was with Far Cry.

I tried searching autoit bug forum with "bugs WinWaitActive" but either there's nothing there or search is useless.

And I have no time to scan through over 1200 bug reports.

I step through this with no problem in Scite:

WinWaitActive ( "Far Cry - InstallShield Wizard" )

Send ( "{ENTER}" )

[ Simple huh? ]

But, when I compile and run it, the ENTER is never acted on--EVEN IF I CLICK THE WINDOW!

Worse, is that it happens a lot, and I never know when it will do it. Ya think your script works

and then ya get the big, screeching halt.

Why is this happening? Again, I know the window has focus.

I'm copying the window name right out of autoit info tool.

It is not an unknown window.

Frustrated Scripting (not so Newb)

ptimeinf...from my experience with automation....its better if you use "Controlsend" commands instead of "Send" commands...from the way you explain the problem it looks like the button that you want to press does not have the focus...if you still want to stick using "send" keys then you will have to send either "tabs" or "arrow keys" to activate the button and then send "Enter"

Share this post


Link to post
Share on other sites

ptimeinf...from my experience with automation....its better if you use "Controlsend" commands instead of "Send" commands...from the way you explain the problem it looks like the button that you want to press does not have the focus...if you still want to stick using "send" keys then you will have to send either "tabs" or "arrow keys" to activate the button and then send "Enter"

Yes, that is sometimes the problem. But in this case the Button comes up with the focus.

Share this post


Link to post
Share on other sites

Yes, that is sometimes the problem. But in this case the Button comes up with the focus.

its kind of hard to guess what the problem is...(unless you can provide the link to the installer)....not sure if I understood this rite but you said it works fine for you using .au3 and not .exe? Did you try using the Autoitsettitle match mode? I personally would use "ControlClick" in this situation...

Share this post


Link to post
Share on other sites

its kind of hard to guess what the problem is...(unless you can provide the link to the installer)....not sure if I understood this rite but you said it works fine for you using .au3 and not .exe? Did you try using the Autoitsettitle match mode? I personally would use "ControlClick" in this situation...

I set the titlematch mode to "3" (read the full line). It was at default.

Made no difference.

Ya souldn't need a sledge when all it will take is a fly swatter. Meaning that the

WinWaitActive...

...Enter

construct should just work correctly. It is simple, clean, and apparently broken.

So far I have heard ways around it. Does any one have any thoughts on

simply making it work correctly?

My Far Cry install script works, by the way. Now what about WinWaitActive?

Share this post


Link to post
Share on other sites

...So far I have heard ways around it. Does any one have any thoughts on

simply making it work correctly?...

Put a Sleep(2000) before the "...Enter" just as a debug in your compiled version. There is a chance that the screen is active and the "Enter" is sent before that screen was ready to accept the "Enter".

If that works, then learn how to use the Control functions to have the script wait for the button to be "ready" (enabled). Sleep will not be reliable, as too many things can mess up the timing.

-MSP-


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Put a Sleep(2000) before the "...Enter" just as a debug in your compiled version. There is a chance that the screen is active and the "Enter" is sent before that screen was ready to accept the "Enter".

If that works, then learn how to use the Control functions to have the script wait for the button to be "ready" (enabled). Sleep will not be reliable, as too many things can mess up the timing.

-MSP-

Thankyou, thankyou very much. Thread terminated

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