Currently have a couple of ImageSearch AHKScripts for clicking on images within a GUI. This GUI is used on multiple screen sizes (laptops, larger monitors, vertical monitors, ect.). The scripts run without issues on my laptop and monitor as long as the scaling is set the same between each monitor ( 100% or 125%). I tried sharing these scripts with a friend so that he could use them on his laptop but the images cannot be found. We're using the same resolution settings (1920x1080), both laptops are using 100% scaling settings, both laptops are of the same make and very similar model but use slightly different graphics cards. (Intel HD Graphics 520 vs Intel HD Graphics 530). We can visually see a slight color difference on his monitor compared to mine and have tried to adjust this as close as possible but these changes do not seem to effect the imagesearch performance. We've tried copying ICM color profile files from one another laptops and still don't have luck. Is there a work-a-round anyone is aware of so we don't need to implement images from each display we use these scripts on? I've played with the "*N variation" parameters from *50-*200 without any luck as well. Any and all suggestions are greatly appreciated, thanks.
'
IfWinExist, GUI
{
WinActivate ; Automatically uses the window found above.
ImageSearch, foundX, foundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 %A_ScriptDir%\\..\Images\UsersIcon.png
if (!errorlevel){
Click %foundX%, %foundY%
}else if (ErrorLevel == 1){
MsgBox, Image cannot be found
}else{
MsgBox, Cannot Conduct Search
}
Sleep, 3500
ImageSearch, foundX, foundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 %A_ScriptDir%\\..\Images\ChangeUserIcon.png
if (!errorlevel){
Click %foundX%, %foundY%
}else if (ErrorLevel == 1){
MsgBox, Image cannot be found
}else{
MsgBox, Cannot Conduct Search
}
Sleep, 500
ImageSearch, foundX, foundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 %A_ScriptDir%\\..\Images\Administrator.png
if (!errorlevel){
Click %foundX%, %foundY%
}else if (ErrorLevel == 1){
MsgBox, Image cannot be found
}else{
MsgBox, Cannot Conduct Search
}
Sleep, 100
ImageSearch, foundX, foundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 %A_ScriptDir%\\..\Images\LogIn1.png
if (!errorlevel){
Click %foundX%, %foundY%, 1
}else if (ErrorLevel == 1){
MsgBox, Image cannot be found
}else{
MsgBox, Cannot Conduct Search
}
ImageSearch, foundX, foundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 %A_ScriptDir%\\..\Images\LogIn2.png
if (!errorlevel){
Click %foundX%, %foundY%
}else if (ErrorLevel == 1){
MsgBox, Image cannot be found
}else{
MsgBox, Cannot Conduct Search
}
ImageSearch, foundX, foundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 %A_ScriptDir%\\..\Images\LogIn3.png
if (!errorlevel){
Click %foundX%, %foundY%
}else if (ErrorLevel == 1){
MsgBox, Image cannot be found
}else{
MsgBox, Cannot Conduct Search
}
ImageSearch, foundX, foundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 %A_ScriptDir%\\..\Images\LogIn4.png
if (!errorlevel){
Click %foundX%, %foundY%
}else if (ErrorLevel == 1){
MsgBox, Image cannot be found
}else{
MsgBox, Cannot Conduct Search
}
Send {WheelDown 5}
Sleep, 500
ImageSearch, foundX, foundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 %A_ScriptDir%\\..\Images\Accept.png
if (!errorlevel){
Click %foundX%, %foundY%
}else if (ErrorLevel == 1){
MsgBox, Image cannot be found
}else{
MsgBox, Cannot Conduct Search
}
Send {WheelUp 3}
}
ExitApp
esc::ExitApp
'
A_ScreenWidth or A_ScreenHeight does not always works on [multiple Monitors] , if you now both resolution you can try to calculate and put manually these value's - example monitor 1 and 2 -replace A_ScreenWidth into 3840 (1920+1920=3840) [or/and] replace A_ScreenHeight into 2160 (1080+1080) - if this not help you can try to change the 3d settings in the NVIDIA CONTROL PANEL for example disable anti aliasing. (Compare it, and look if your friend does have the same settings like you.)