Code: Select all
imageName := "image.png"
f::
ImageSearch, posX, posY, 0, 0, A_ScreenWidth, A_ScreenHeight, %imageName% ; <<< variable
If ErrorLevel = 2
{
MsgBox, 2
}
Else If ErrorLevel = 1
{
MsgBox, 1
}
Else If ErrorLevel = 0
MsgBox, 0
return
This code gives me only Errorlevel = 2 as a result. Does ImageSearch simply not accept this syntax?
I tried a few variations on this to double check spelling and correct directory, for example:
Code: Select all
f::
ImageSearch, posX, posY, 0, 0, A_ScreenWidth, A_ScreenHeight, image.png ; <<< actual file name
If ErrorLevel = 2
{
MsgBox, 2
}
Else If ErrorLevel = 1
{
MsgBox, 1
}
Else If ErrorLevel = 0
MsgBox, 0
return
Any help greatly appreciated! Thank you!