I was mistaken about the script that checks my email, but this is one I just tested, it checks for an icon in system tray.
I chose AC power by using printscreen and paint to crop an image of what I wanted to find.
The mousemove command could probably be changed to mouseclick or click command.
Code:
CoordMode, ToolTip, screen
CoordMode, Mouse, screen
CoordMode, Pixel, screen
SysGet, VirtualScreenWidth, 78
SysGet, VirtualScreenHeight, 79
SysGet, VirtualScreenLeft, 76
SysGet, VirtualScreenTop, 77
;=====================================
; the image name to search for, in working directory
;=====================================
image_name= AC_ICON.bmp
ImageSearch, OutputVarX, OutputVarY, VirtualScreenLeft, VirtualScreenTop
, A_ScreenWidth, A_ScreenHeight, %image_name%
if (errorlevel<>0)
{
msgbox For !%image_name%! ErrorLevel was %ErrorLevel% `nErrorLevel is set to 0 if the image was found in the specified region, 1 if it was not found
, or 2 if there was a problem that prevented the command from conducting the search (such as failure
. to open the image file or a badly formatted option). `n`n press OK to exit.
}
else
{
msgbox, , , Upper left corner of %image_name% is at %OutputVarX% %OutputVarY%`n Move the mouse there!, 1 ; Leef_me
mousemove, %OutputVarX%, %OutputVarY%, 50
; my icon is 16 x 16 so I can move to it's approx center by using this
mousemove, OutputVarX+8, OutputVarY+8, 50
msgbox press OK to exit.
}