Focus and/or timing issue with MS Pro ??

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
bnc1
Pro Scripter
Posts: 127
Joined: Sun Jul 31, 2005 5:10 pm

Focus and/or timing issue with MS Pro ??

Post by bnc1 » Fri Mar 27, 2009 2:52 pm

I have a set of macros that I use to automate a "hobby" application which I have been using successfully for years with Macro Scheduler Standard. The app is very sensitive to timing and I constantly look for ways to tweak it and improve performance. Yesterday I decided to trial Macro Scheduler Pro to see if a compiled version would offer any performance enhancements.

Unfortunately I seem to have some kind of focus and/or timing problem that doesnt appear when using Macro Scheduler standard. The hobby application I automate runs full screen, always on top, and there are lots of windows opening and closing that I never see due to the always on top status of the main full screen window. In addition I create a small Macro Scheduler window with the Message> command with attributes MSG_STAYONTOP=1 that appears by design in the lower right corner of the screen with statisical info that I can see. Not sure how this works with two windows both defined as "always on top" but it has worked just fine for years with MS Standard. For some reason this MS mini window is causing the main app to lose focus and I cant seem to fix it... setfocus and mouse clicks seem to have no effect. If I dont create the MS window or I dont use MSG_STAYONTOP=1 the app runs fine under MS Pro.

Again ..none of this happens when using MS Standard. There is probably a simple explanation for this but for now I am "dazed and confused"

Any thoughts ?? :shock: :P

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Mar 27, 2009 7:36 pm

Is this being done on the same physical system?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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

Are you running it compiled?

Post by gdyvig » Fri Mar 27, 2009 10:41 pm

You bought Pro to try out compiled macros.

Are you running Pro compiled or uncompiled?

I would try uncompiled first.


Gale

bnc1
Pro Scripter
Posts: 127
Joined: Sun Jul 31, 2005 5:10 pm

Post by bnc1 » Fri Mar 27, 2009 11:21 pm

Is this being done on the same physical system?
Yes , same physical system

You bought Pro to try out compiled macros.
Are you running Pro compiled or uncompiled?
I would try uncompiled first.
Uncompiled works fine

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

Search "compiled focus"

Post by gdyvig » Sat Mar 28, 2009 1:10 am

This problem has been reported before. Search this site for the words compiled and focus and you will find:

http://www.mjtnet.com/usergroup/viewtop ... 6cfb8536f5

and



http://www.mjtnet.com/usergroup/viewtop ... 8924#18924

and a couple other similar ones.


Are you able to get it working now?



Gale

bnc1
Pro Scripter
Posts: 127
Joined: Sun Jul 31, 2005 5:10 pm

Post by bnc1 » Sat Mar 28, 2009 9:11 pm

This problem has been reported before. Search this site for the words compiled and focus and you will find
I was hopeful when I read the links posted but compile options are not the issue. After several hours of trial and error, I have a solution. A possible complication of this issue is the fact that this is not just one simple script. The setup I use successfully under MS Standard is several scripts all linked via macro>commands. When running under MS Pro, I have converted just the most active script to a compiled version.

This code worked in the MS Standard setup :

Message>message data
Setfocus>Application Window
LClick

The mouse click is needed so that the application will accept keyboard commands. The setfocus command by itself is not enough.

Under MS Pro, I had to use this code:

Message>message data
Let>WW_TIMEOUT=5
WaitWindowOpen>Macro Scheduler Message
Setfocus>Macro Scheduler Message
LClick
Setfocus>Application Window


And now on to the next problem. Getwindowtextex> issues ...

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