Help with WinWaitActive Please

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Patrick_Dayna
Posts: 44
Joined: 01 Jun 2021, 15:48

Help with WinWaitActive Please

24 Jun 2021, 00:02

FrameCapture_36.jpg
FrameCapture_36.jpg (48.04 KiB) Viewed 193 times

Code: Select all

WinWaitActive, Confirm Save As,, 3           
if ErrorLevel
  {
      MsgBox, Win Not exists
      return
  }
else 
MsgBox, Win exist
Return
It will not activate the small confirm save as box
In the code snippet above. MsgBox, Win Not exists always triggers
Thank you!
gregster
Posts: 9002
Joined: 30 Sep 2013, 06:48

Re: Help with WinWaitActive Please

24 Jun 2021, 00:51

So, it always times out. The question is: what happens before this line?
One thing is clear, once this line gets reached, it times out after three seconds and code execution continues. What's the code above it?

How do you make sure that it doesn't get reached while you are still working (manually) in the Save dialog...? Or, do you also automate that?
What happens if you remove the timeout? Does it wait for that window?

It will not activate the small confirm save as box
I see nothing in your code that would do that.
But doesn't it activate automatically, once it appears?
(There is a commented out WinActivate, Save As line (not Confirm Save As) in your picture - wrong wintitle? wrong title match mode? What's the intention?)
User avatar
Patrick_Dayna
Posts: 44
Joined: 01 Jun 2021, 15:48

Re: Help with WinWaitActive Please

25 Jun 2021, 21:49

gregster wrote:
24 Jun 2021, 00:51
So, it always times out. The question is: what happens before this line?
It will not activate the small confirm save as box
I see nothing in your code that would do that.
But doesn't it activate automatically, once it appears?
(There is a commented out WinActivate, Save As line (not Confirm Save As) in your picture - wrong wintitle? wrong title match mode? What's the intention?)
Oh, that was the window I was primarily programing for(The save as... Dialog). I later on realised I would encounter use cases where I msgbox would pop up asking if I wanted to overwrite a file. So I copied what I had already written and tried to repurpose it for the overwrite dialog.

I rethought my design and no longer need to do this as I have found better means, thanks allot Gregster!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 335 guests