Quick question: If I have a script that will open an application, and I need to have the script execute twice at the same time, will the use of window handles work even if I'm using image recognition to find things on a window?
I'm thinking the script will (loosely):
set WIN_USEHANDLE on
launch an application
GetActiveWindow
SetFocus
and from then on, anything happening in the script will happen within that window. Then, when I launch the script a second time, the handle for GetActiveWindow will be different, so the second instance of the script will deal with the second window.
It looks like the image recognition calls can use the Window title as the haystack - can it use the window handle?
Do I have to SetFocus before each command?
Do I need to size the windows so they don't overlap?
Do I sound crazy?
Multiple execution of the same script
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Multiple execution of the same script
Not sure how the same macro could do the same thing twice at the same time. Perhaps you mean in succession, not at the same time.
Always setting focus is not always necessary but good practise - something could steal the focus. But often with image recognition you then click on the UI object and that would have the same effect. So as always it depends whether you really need a SetFocus or not but it would certainly do no harm.
Always setting focus is not always necessary but good practise - something could steal the focus. But often with image recognition you then click on the UI object and that would have the same effect. So as always it depends whether you really need a SetFocus or not but it would certainly do no harm.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?