Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

WinWaitActive not working as expected


  • Please log in to reply
2 replies to this topic
Adilson
  • Members
  • 1 posts
  • Last active: Mar 23 2015 06:39 PM
  • Joined: 22 Mar 2015

My script is like this:

LOOP{
	IfWinNotActive Andy
	{
		WinActivate Andy
		WinWaitActive Andy
		MouseGetPos x, y
		click 715,345
		MouseMove x,y
		Send !{TAB}
	} else {
		click 715,345
	}
	Sleep 10000
}

But the mouse is moving and clicking before the "Andy" window is on screen.

The same script were working correctly before. What may be causing this?



nnnik
  • Members
  • 1625 posts
  • Last active: Apr 11 2017 02:13 PM
  • Joined: 28 Jul 2012
There could be several reasons. I suggest adding a sleep after the WinWait command.
Also avoid having multiple windows with the name Amdy.

Visit the new forum ahkscript.org.

http://ahkscript.org


Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

WinWaitActive only waits until the active window has the given title; it does not check whether the window is visible or ready to be interacted with.