FindImagePos using SCREEN fails under Remote Desktop

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
dpklump
Newbie
Posts: 2
Joined: Wed Apr 07, 2010 7:31 pm

FindImagePos using SCREEN fails under Remote Desktop

Post by dpklump » Wed Apr 07, 2010 8:11 pm

Am currently on MS Pro version 11.1.19 and according to the version history this problem was fixed in version 11.1.12 29/06/2009: FindImagePos using SCREEN for haystack fails under Remote Desktop/Terminal Server session

My script works using the XP and Classic styles on my machine, but when I run it on our server via Remote Desktop it returns a "Invalid Numeric Value for Mouse Move Command as FindImagePos did not find the needle file (NumFound = 0).

Code: Select all

FindImagePos>C:\MS_exe\Pics\nsExportSelectAll.bmp,SCREEN,0,1,X,Y,NumFound
IF>NumFound>0
    MouseMove>X_0,Y_0
    Wait>.5
    LClick
ELSE
    FindImagePos>C:\MS_exe\Pics\nsExportSelectAllc.bmp,SCREEN,0,1,X,Y,NumFound
    MouseMove>X_0,Y_0
    Wait>.5
    LClick
ENDIF
The first FindImagePos looks for the XP Style needle and the second looks for Classic Style needle. BOTH of these work on my machine. But not on our server (Win 2003) via Remote Desktop.

Please help.

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Increase color tolerance

Post by gdyvig » Thu Apr 08, 2010 12:06 am

Often the color depth thru a remote desktop is reduced from 24/32 bit to 16bit. Increasing the color tolerance parameter to a value of 10 for the FIP command usually takes care of it.

If the needle image is dithered (solid color displayed as dots of alternating colors) on the remote desktop you may need to capture another image for that environment.


Gale

dpklump
Newbie
Posts: 2
Joined: Wed Apr 07, 2010 7:31 pm

Update

Post by dpklump » Thu Apr 08, 2010 1:51 am

Thanks for your reply.

Unfortunately, changing the color tolerance from anywhere between 10 and 200 did not rectify the problem. Nor did using needle files produced of that environment. (Unless I actually have to install MS on the Server and using Image Capture grab the needle files. I did use ClipMagic on the Server to produce the needle files. Was this wrong?)

The weird thing is it was working via remote desktop in early testing using needle files taken from my machine, but now it doesn't.

Any further suggestions?

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Post by gdyvig » Thu Apr 08, 2010 2:24 pm

Make sure your all local desktops and all remote desktops are set to standard display options. That includes Theme, Color scheem, and Effects. It is best to turn all Effects off, especially font smoothing - anything that will alter the display.

It should not be necessary to install MS on the Server to make the Image Recognition commands work.

Sometimes third party image capture tools produce images at a lower color depth.

Try inserting a ScreenCapture command in your script at the point where you expect the needle image to be visible. Capture it as a bmp file and compare it too your needle file under a magnifier. Sometimes you can spot obvious differences this way. To detect more subtle differences set the Macro Scheduler cursor to display the Pixel Color.

Remember with remote desktop the image displayed is the lowest common demoninator between the capabilities of the local and remote displays. Set both at the highest possible color depth. Also check your RDP display options.

There are also many posts in the forum on this subject. Search by Remote, mstsc, color depth, etc.


Gale


Gale

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

Post by idiot » Sun Apr 11, 2010 5:08 am

how about running the remote desktop and getting the image you need that way so it is the same if you get from actual machine and try to run remotely it will be different image cause otherwise it will seem as an entirely different image to the macro cause not only do remote desktops like team viewer change color depth they also resize the image so it will not be detected as the same image so run your teamviewer and get the image remotely and use that for the macro and it will work usually the simplest answer is correct and can be easily overlooked
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts