so it does click spacebar
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
toggle := 0
return
^l::
toggle = !toggle
if (toggle = 0){
SetTimer, LocCheck, Off
}
else{
SetTimer, LocCheck, 2000, On
}
return
SetTitleMatchMode 2
SetTitleMatchMode Slow
LocCheck:
{
IfWinExist, Downloads
{
WinGetPos, xPos, yPos, WinWidth, WinHeight, Downloads
CoordMode, Pixel, Screen
endxPos := xPos + WinWidth
endyPos := yPos + WinHeight
ImageSearch, x, y, %xPos%, %yPos%, %endxPos%, %endyPos%, D:mypicture.PNG
if ErrorLevel = 2
Sendinput {space}
else if ErrorLevel = 1
ToolTip, Not Found, 50, 50
else
ToolTip, Found at %x% %y%, 50, 50
Return
}
}
F8::ExitApp