Image Recognition: what screen is SCREEN param capturing?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
AlexL
Newbie
Posts: 8
Joined: Thu Dec 06, 2007 5:35 pm

Image Recognition: what screen is SCREEN param capturing?

Post by AlexL » Wed Feb 13, 2008 4:58 pm

I start the Citrix client and I am logged in. In the Citrix windows I have the desktop. In the desktop I am looking for an icon, which I saved as Icon1.bmp.

The code below returns NumFound=0

Code: Select all

SetFocus>SRK GS - Citrix*
Wait>1
FindImagePos>C:\Icon1.bmp,SCREEN,20,1,Xpos,Ypos,NumFound
However, when I capture the full Citrix screen myself and use it instead of SCREEN, I do find my icon.

Is the SCREEN parameter capturing the wrong screen? On my workplace I have two screens; the Citrix client windows is on one, the Macro Scheduler Editor on the other.

Interestingly, the script above (with SCREEN) did work a few days ago, but I don't know what's different now.

Am I missing something?

TIA

Alex

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Feb 13, 2008 5:30 pm

SCREEN will capture the MAIN screen (PRIMARY monitor).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

AlexL
Newbie
Posts: 8
Joined: Thu Dec 06, 2007 5:35 pm

Post by AlexL » Wed Feb 13, 2008 6:21 pm

mtettmar wrote:SCREEN will capture the MAIN screen (PRIMARY monitor).
Well, the Citrix window is precisely on the primary monitor (the one with positive X and Y) !

Besides, doesn't the SetFocus determine which window will be captured?

So, what should I try next?

Thanks in advance.

Alex

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Feb 13, 2008 6:23 pm

Which version of Macro Scheduler are you using? See under Help/About.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

AlexL
Newbie
Posts: 8
Joined: Thu Dec 06, 2007 5:35 pm

Post by AlexL » Wed Feb 13, 2008 6:46 pm

mtettmar wrote:Which version of Macro Scheduler are you using? See under Help/About.
10.017e trial

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Feb 13, 2008 6:54 pm

Hmmm. Build 017 should be ok as no issues with image recognition have been fixed since then. But the latest version is 10.0.19.

What did you use to capture the icon? Be sure to use Macro Scheduler's Image Capture tool to capture the screen area you want to look for (Tools/Image Capture Tool in the Advanced Editor)

Not sure why it's not working with SCREEN, but perhaps it just needs more time. You could use the old method which does a ScreenCapture first:

GetScreenRes>sX,xY
ScreenCapture>0,0,sX,xY,d:\screen.bmp
FindImagePos>needle,d:\screen.bmp,0,1,XPos,YPos,NumFound

Does that method work ok?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

AlexL
Newbie
Posts: 8
Joined: Thu Dec 06, 2007 5:35 pm

Post by AlexL » Thu Feb 14, 2008 2:36 pm

mtettmar wrote:Be sure to use Macro Scheduler's Image Capture tool to capture the screen area you want to look for
I always do.
You could use the old method which does a ScreenCapture first:
This method works OK, but the new one is much more confortable.
Hmmm. Build 017 should be ok as no issues with image recognition have been fixed since then. But the latest version is 10.0.19.
I installed 10.0.19 and SCREEN works again for Windows screens (it didn't before), but not in a Citrix window. I also rebooted my PC, so that I am not sure what caused the change. I feel somewhat confused, because a few days ago everything was OK.

For the SCREEN method, the NumFound code is 0. What does it mean?

Is there a way for me to check what image does the SCREEN method create?

TIA

Alex

Edited after 10 min.: just tested again - the SCREEN method doesn't work anymore even for normal windows!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 14, 2008 2:48 pm

>This method works OK, but the new one is much more confortable.

Both methods use the same internal code to capture the screen, so I'm a bit baffled as to why there's a difference unless the difference is timing - with the old system you're introducing a small delay between the capture and the check. Perhaps that's needed in your case. If so I'd stick with that method. The method that works comforts me more than the one that doesn't!

0 means no image was found.

When you say *IN* a Citrix window, what do you mean - a Citrix client window *IS* a Windows window? We can capture anything within that window. Basically we can capture what is on YOUR screen. If that includes a Citrix window we will see the contents of that.

I'd be interested to see what you are seeing. If you would like to arrange a remote desktop sharing session please email support and we can hook up and look at your screen: http://www.mjtnet.com/contact.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 14, 2008 3:04 pm

Hold the presses! I think I've discovered what might be causing your problem. Will PM you a fix to try.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 14, 2008 4:58 pm

Problem solved and fixed in 10.0.20! Issue only affected some multi-monitor setups.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

AlexL
Newbie
Posts: 8
Joined: Thu Dec 06, 2007 5:35 pm

Post by AlexL » Thu Feb 14, 2008 5:34 pm

I am really impressed !

Alex

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