The problem: I want to have a script move the mouse cursor over the 'add to chrome' button of a chrome extension page (using this one: https://chrome.google.com/webstore/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcleb)
My approach: Use PixelSearch to find the color of a given pixel in the button.
Code: Select all
f::
CoordMode, Pixel, Screen
PixelSearch, Px, Py, 0, 0, 1920, 1000, 0x1A73E8, 0, Fast
if ErrorLevel
MsgBox, That color was not found in the specified region.
else
MsgBox, results, %Px%, %Py%
Any ideas where I'm going wrong? My screen res is 1920x1080 (but I do have multiple monitors, don't know if that could interfere with this)
Thanks!
Also tried this to no avail (with the jpg being a snippet of the button in image form)
Code: Select all
f::
CoordMode Pixel ; Interprets the coordinates below as relative to the screen rather than the active window.
ImageSearch, FoundX, FoundY, 0,0,1900,1070, C:\Users\<myWinUser>\addto.jpg
if (ErrorLevel = 2)
MsgBox Could not conduct the search.
else if (ErrorLevel = 1)
MsgBox Icon could not be found on the screen.
else
MsgBox The icon was found at %FoundX%x%FoundY%.