Jump to content
Macro Express Forums

Delete Macro From Queue ?


Pete

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :ph34r:

 

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...