ImageSearch unable to find image when in Chrome on second monitor
Posted: 07 Sep 2018, 15:46
[Moderator's note: Topic moved from Bug Reports.]
I have a dual monitor setup. The left monitor is the main monitor and is 2560x1080. The right monitor is the secondary monitor and is 1920x1080.
The above script is able to find beachball.PNG on both monitors if I have the file show in a file explorer window. However, this script is meant to detect the image in Chrome and the script only works if Chrome is on the main monitor. ImageSearch is unable to find the image if Chrome is on the second monitor.
Code: Select all
#KeyHistory 0
#InstallMouseHook
#InstallKeybdHook
;SysGet, leftMostPoint, 76
;SysGet, topMostPoint, 77
SysGet, totalWidth, 78
SysGet, totalHeight, 79
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
CoordMode, ToolTip, Screen
^esc::exitapp ; <- PANIC BUTTON (Ctrl + Esc)
global active := 0
NumpadSub::
ImageSearch, foundX, foundY, 0, 0, totalWidth, totalHeight/2, *5 beachball.PNG
if (!ErrorLevel) {
SoundPlay, icq-uh-oh.mp3 , wait
ToolTip, % foundX . ", " . foundY, foundX, foundY+25, 1
active := 1
while (active) {
ImageSearch,,, foundX, foundY, foundX+20, foundY+20, *5 beachball.PNG
if (ErrorLevel) {
SoundPlay, icq-uh-oh.mp3 , wait
sleep 10000
}
sleep 750
}
}
return
The above script is able to find beachball.PNG on both monitors if I have the file show in a file explorer window. However, this script is meant to detect the image in Chrome and the script only works if Chrome is on the main monitor. ImageSearch is unable to find the image if Chrome is on the second monitor.