Pete Posted July 10, 2004 Report Share Posted July 10, 2004 Hi! I have a macro [main] which runs continuously (every 1 second). To disable/enable this macro I have a 2nd macro [togglemain] which is activated from a menu (located on the taskbar). The problem I have is that by the time I DISABLE the [main] macro, it is already in the queue to run again - so it always runs one more time after [togglemain] issues the DISABLE command. I could get round this by getting the [main] macro to check a registry switch in line 1, and control that switch from [togglemain]. However, I wondered if there was a way of deleting macros already waiting in the queue to run ? Thanks - Pete. Quote Link to comment Share on other sites More sharing options...
Jim Korenthal Posted July 10, 2004 Report Share Posted July 10, 2004 Hi Pete, I'm very interested in Joe and the others' response to this. Could you clarify which "queue" you're talking about? My understanding was that ME cannot start a macro while another one is running, and therefore no execution queues would be necessary. I tried to simulate your situation with the following two macros: Test1 puts up a box for 1/2 second and then ends. It is set to fire up every 2 seconds. Test2 simply disables Test1. I found that if I ran Test2 when Test1's box was down, it unfailingly disabled Test1 immediately -- I saw no more boxes. And if I tried to run Test2 while Test1 was active (the box showed), nothing happened and Test1 was not disabled. These results were consistent with what I expected. That said, unless the guys who really know ME have a better idea, I think your registry workaround is very reasonable -- I'd use it myself with no twinges of the internal kludge guiltmeter. - Jim Quote Link to comment Share on other sites More sharing options...
Pete Posted July 10, 2004 Author Report Share Posted July 10, 2004 Hi Jim, You are correct that only 1 macro can execute at a time, but if you schedule several macros to start at the same time - they will all run - one after the other. So there should be some sort of internal "queue" of macros waiting to execute? Well that's the way I see it anyway My macros wait for each other to finish, but it seems that disabling a macro after it's scheduled start time does not prevent it running (once). Pete. Quote Link to comment Share on other sites More sharing options...
joe Posted July 12, 2004 Report Share Posted July 12, 2004 Hello Pete! What happens if you turn both caching options off? Quote Link to comment Share on other sites More sharing options...
Pete Posted July 12, 2004 Author Report Share Posted July 12, 2004 Hi Joe! It makes no difference, I guess because the [main] macro is not window activated? Pete. Quote Link to comment Share on other sites More sharing options...
kevin Posted July 12, 2004 Report Share Posted July 12, 2004 Some types of macro activations, like scheduled macros, are queued. Others are not. A HotKey activation is never queued. Whether or not a Window Activated macro is queued is controlled by the 'Enable Window Activation Caching' option that Joe mentioned. There is no way to add or delete activations from the internal queue. Your suggestion of storing a flag in the registry should work. Another idea would be to add a 'Disable Macro' command at the top of your scheduled macro and an 'Enable Macro' command at the end of it. This will prevent any additional activations of that macro during the time that the macro is running. However, you will have to make sure that the 'Enable Macro' command does not interfere with your existing routine to disable the macro. Quote Link to comment Share on other sites More sharing options...
Pete Posted July 13, 2004 Author Report Share Posted July 13, 2004 Thanks Kevin, I think I'll go the registry flag route. Pete. 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.