Haystack + Wildcard = Fail

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
fightcancer
Macro Veteran
Posts: 239
Joined: Fri Apr 15, 2005 8:32 am

Haystack + Wildcard = Fail

Post by fightcancer » Sun Aug 17, 2014 9:02 pm

When I use FindImagePos> and try to specify the Haystack by using a wildcard, the macro fails to find the image.

Is this by design?

Thanks!

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

Re: Haystack + Wildcard = Fail

Post by Marcus Tettmar » Mon Aug 18, 2014 5:58 am

Can you explain what you mean? Haystack can't take a wildcard. That makes no sense. There can be only one haystack. But it can be SCREEN.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

fightcancer
Macro Veteran
Posts: 239
Joined: Fri Apr 15, 2005 8:32 am

Re: Haystack + Wildcard = Fail

Post by fightcancer » Tue Aug 19, 2014 5:22 am

Sorry I wasn't clearer.

In SetFocus, the window_title may contain the * symbol at the end to indicate a substring match. However, in FindImagePos, the WINDOW:title option does not allow for the * symbol to be used.

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

Re: Haystack + Wildcard = Fail

Post by Marcus Tettmar » Tue Aug 19, 2014 5:54 am

Correct. You could do this:

SetFocus>Window*
GetActiveWindow>title
FindImagePos>needle,WINDOW:title,etc,....





Sent from my iPad using Tapatalk
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

fightcancer
Macro Veteran
Posts: 239
Joined: Fri Apr 15, 2005 8:32 am

Re: Haystack + Wildcard = Fail

Post by fightcancer » Tue Aug 19, 2014 7:45 am

That works! Thanks for the great support!

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