Code Editor Opens on its own.

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
MikeSr
Junior Coder
Posts: 20
Joined: Sun Feb 07, 2010 8:31 pm
Location: Fort Myers, FL
Contact:

Code Editor Opens on its own.

Post by MikeSr » Tue Jan 11, 2011 2:44 pm

I am running version 11.1.23.
My code has been running perfectly for months. Suddenly I noticed that the code window (editor) was open. I closed it and the macro continued.
Take a look a while later and its open again.
I have rebooted, Shutdown, and restarted, and now I have re-installed 11.1.23.
What would cause the editor to open? I have 6 macros.
the first is my executive that calls the other 5 individualy until they are completed. it always pops open the Executive macro.

Regards,

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

Post by Marcus Tettmar » Tue Jan 11, 2011 4:25 pm

What would cause the editor to open?
One possibility is that one of your macros is sending keystrokes/mouse events which are landing on Macro Scheduler unwittingly and causing the editor to open. I.e. your macro is not correctly using SetFocus.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

MikeSr
Junior Coder
Posts: 20
Joined: Sun Feb 07, 2010 8:31 pm
Location: Fort Myers, FL
Contact:

Post by MikeSr » Fri Feb 11, 2011 11:36 am

I have the problem solved. I hope this reply provides some insight to the original problem.
1) The macro is running and Macro scheduler is visable.

2) When Macro scheduler console is open ( I have the window sized small just to see the "Run Now Stop" buttons and the Macro list) and the cursor left the macro highlighted, this is when the problem occurs.

I used a series of keystrokes to get the "macro" in my list of 7 macros to not be hightlighted and as a result my code window never opened again.
I should not have to begin with as my program has been running flawlessly since the last post plus a less a couple of days for finding the problem.

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

Post by Marcus Tettmar » Fri Feb 11, 2011 11:47 am

Something must be pressing the enter key or doing something to cause the macro to open in the editor.

Just moving the mouse is not sufficient to cause the editor to open. We haven't seen your script but I suspect your script has a "press enter" or some other keystroke which is landing on the Macro Scheduler console which causes the editor to open. You've solved it by making sure no macro is highlighted. But the better solution is to stop sending keystrokes to the macro scheduler console. I suspect there's a SetFocus line missing somewhere.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

MikeSr
Junior Coder
Posts: 20
Joined: Sun Feb 07, 2010 8:31 pm
Location: Fort Myers, FL
Contact:

Post by MikeSr » Fri Feb 11, 2011 2:01 pm

The macro run alone on a stand alone pc. There is no user "ever" moving a mouse or pressing any key.
This is a data logging system. So, macro scheduler reviews status of internet connections , restarts them periodicaly, monitors the logging software for appropriate windows to be open etc..
While I do set focus to specific items at times and use the enter key, leaving macro scheduler and a macro highlighted occasionally causes the editor to open the highlighted window. Thus my macro is halted.

My point is that when you select a macro to run, the macro remains highlighted and thus the problem.
I am not sure what the correct work around is, other than knowing this can occur and making sure the macro is not highlighted.

Please understand, my macros's run flawlessly. This is just a note in the event someone else runs into this problem.

Kind Regards,

Michael

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Fri Feb 11, 2011 2:11 pm

While I do set focus to specific items at times
While I believe you that this may be working for you in this particular case, in general the "SetFocus" command should be used almost religiously to ensure trouble free scripts.

Any thing that happens out of the ordinary can cause the focus of one window to shift to another, and then keystrokes are being sent to the wrong windows.

Trust me. I've been doing this awhile.

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