However, if I launch the AHK script by double-clicking it from windows explorer, ImageSearch works as expected.
Am I launching it incorrectly from NP++? I don’t understand why the script is not running correctly when it is launched from NP++.
Do I need an addon or something?
Code: Select all
#SingleInstance Force
CoordMode, Pixel, Screen
IfNotExist, %USERPROFILE%\Downloads\HappyFace.jpg
{ UrlDownloadToFile, https://www.autohotkey.com/boards/download/file.php?id=14008, %USERPROFILE%\Downloads\HappyFace.jpg
SoundBeep, 300, 50
} SplashImage, %USERPROFILE%\Downloads\HappyFace.jpg, A FS12, Image
Loop, 3
{ ImageSearch, X, Y, 0, 0, A_ScreenWidth, A_ScreenHeight, *60 HappyFace.jpg
If !(ErrorLevel)
{ MsgBox, Immage Found
Exitapp
} SoundBeep, 200, 50
Sleep, 500
} MsgBox, No Immage Found
ExitApp
*~Esc::ExitApp