However you need to know where to look when finding which command changed the errorlevel - or if it is even a command that doesn't change the ErrorLevel.
This is quite the opposite of newbie friendly. As a newbie I remember getting stuck by this more times than I can imagine.
It would be so much easier if AHK could just tell you when an error happened - I mean it knows that an error happened why doesn't it simply tell you?
And AHK actually can tell you. All you have to do is wrap the code you should tell you when and where an error appears in this:
Code: Select all
Try {
;your code here
} Catch e
Throw e
Code: Select all
Try {
Msgbox looking for things
ImageSearch, outputX, outputY, 10, 10, 100, 100, missing.jpg
Msgbox doing more things
} Catch e
Throw e