Jomdom Posted January 7, 2006 Report Share Posted January 7, 2006 I am currently writing a macro for a program that is fairly buggy. It crashes occasionally, and therefore I want to be able to poll the status of the program every 10 seconds or so as my macro is running. The only way I can figure out how to do this is to actually inject the logic right into the macro itself, thus causing horrible duplication and a cluttered scripting/direct editor. So my question is this: is there any way to repeatedly loop through X lines of logic every Y seconds while another macro is running? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
joe Posted January 7, 2006 Report Share Posted January 7, 2006 You can only run one macro at a time. Quote Link to comment Share on other sites More sharing options...
Jomdom Posted January 7, 2006 Author Report Share Posted January 7, 2006 Okay, so here's a long shot... Would it be possible to run two instances of ME, with program status being polled via a scheduled macro every 1 minute in one instance, with the other macro running in the other instance? I realize there would be serious conflicts if both tried to take control of keyboard or mouse, but what about simple status checking & variable setting/clearing? Quote Link to comment Share on other sites More sharing options...
joe Posted January 7, 2006 Report Share Posted January 7, 2006 This might work under XP if you launch two instances as two different users, switching between them. You would not, however, have access to the other's memory space, so you will not be able to check variables. Instead, write the variables to a CSV file and have the other instance check them. Timing in this scenario is everything so use the Wait for File Exist and Wait for File Ready commands. Quote Link to comment Share on other sites More sharing options...
kevin Posted January 7, 2006 Report Share Posted January 7, 2006 This might work under XP if you launch two instances as two different users, switching between them.This will work if you have 'Fast User Switching' enabled in Windows XP. Another thing to consider would be to create a separate macro that performs the 'monitoring' function you desire. Then in the main macro put Macro Run commands to 'call' the monitoring macro at strategic locations. This wouldn't cause too much clutter. You could even set a variable at the top of the main macro and check that variable within the called macro to turn off the monitoring. Quote Link to comment Share on other sites More sharing options...
jplissner Posted March 21, 2007 Report Share Posted March 21, 2007 I have tried to open multiple instances of ME. This will not work under Windows XP. What am I doing wrong? Thanks. Jeff Quote Link to comment Share on other sites More sharing options...
kevin Posted March 21, 2007 Report Share Posted March 21, 2007 In order to do this you need to make sure that Windows XP has 'Fast User Switching' enabled and that you have more than one user login. When you log on as one user Macro Express gets loaded for that user. When you 'switch' to another user, that user login has Macro Express running. Both are running at the same time. There are limitations, however. When you switch from one user to another, a macro will continue to run for the user that is logged in but is not active. But Windows will not send keystrokes and mouse events to a program that does not have focus so the macro may appear to stop functioning. Quote Link to comment Share on other sites More sharing options...
jplissner Posted March 22, 2007 Report Share Posted March 22, 2007 Ah...thanks Kevin. So this probably won't work for what I want it for. I am trying to simulate many users doing meaningful work simultaneously in order to test the impact of load on our new system. Jeff Quote Link to comment Share on other sites More sharing options...
wbeldman Posted March 22, 2007 Report Share Posted March 22, 2007 You might be looking for User Submitted Macro: Heartbeat Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.