Jump to content
Macro Express Forums

macro stop


Recommended Posts

i want to use a timed command to stop all macros running. I set up one tonight and use the "macro stop" command but it just runs but have yet to stop anything. is there a way to run the all stop macros and then start again on "time of the day"

 

recap:

 

I want the macro to run non stop until it is told to stop by a scheduled macro. i tried to create "stop macro" at stop running at 0700 (example) and the main macro just kept running. How do i made it stop all active macro and i will start a new macro after i get all to stop.

 

thanks

 

MBone

Link to comment
Share on other sites

If I understand you correctly, Macro A is running, and you want Macro B to stop A from running.

 

The Macro Stop command ends the macro in which the command is coded. In other words, Macro A can end itself with the Macro Stop command, but B can't stop A.

 

In B, try using the Macro Disable command to disable A. I think that will stop A in mid-stream if A is running. It will also keep A from running again, until you issue a Macro Enable.

Link to comment
Share on other sites

Another way of doing it will work for sure but requires that all macros that you want to run have some extra commands.

 

Have each running macro check the value of a text file every so often. If the text file (one word) says "run", keep going, if it says "stop" Macro Stop. You can set the "stop" by another macro. Starting again as scheduled macros, the first thing a macro does is to write "run" to the file on the first run (only) through the commands.

 

If you want to start certain macros only (such as the ones that were stopped from running) you will have to create a list of some kind. That can also be in the form of a text file. The control macro starts the macros listed at its scheduled time. If you want to have multiple starts, run control macros at those times with different macro lists.

 

I'm sure this method could be implemented in several ways.

Link to comment
Share on other sites

I was trying not to go back and add anything to any one of the modules (i build in parts), I think i will just add it to the begining. I just could not find the macro command that i seen before. I upgrade from 3.x to pro and when i did some imports at least one of them added the "stop all other macro command" to the beginning.

 

thanks and i just found it. it was the lock player command, i just could not find one that it was on before. I am going to see about creating around it.

 

Mbone

Link to comment
Share on other sites

Lock Player only prevents other macros from starting (other than manually via Macro Explorer). It will not stop running macros.

 

(edit1) Something else to bear in mind, you cannot stop macros that are in Delays. You will have to wait until the timing finishes. If that is a problem, break down the timer. If you want 30 minutes, make a one minute loop of 10x6sec delays and repeat 30 times (or 300x6sec once). Not as accurate but will stop within 6 secs.

 

(edit 2&3) How about Mouse to Tray and right-click on the running man until all stop? I tried it and it stopped all running macros. In the stop macro, set the Tray icon name to "Macro Express Pro - Macros currently running". Seems to work on single and multiples.

Link to comment
Share on other sites

In B, try using the Macro Disable command to disable A. I think that will stop A in mid-stream if A is running.

Sorry, this is not correct. The Macro Disable command prevents a macro activation. It does not stop a macro once it is running.

 

It will also keep A from running again, until you issue a Macro Enable.

Yes, this is correct.

Link to comment
Share on other sites

Another way of doing it will work for sure but requires that all macros that you want to run have some extra commands.

 

Have each running macro check the value of a text file every so often. If the text file (one word) says "run", keep going, if it says "stop" Macro Stop. You can set the "stop" by another macro. Starting again as scheduled macros, the first thing a macro does is to write "run" to the file on the first run (only) through the commands.

Yes, this is how I would approach the task.

 

One macro cannot directly stop another. However, a second macro can set an 'external something' that the first macro interprets that it is time to stop. This 'external something' can be a file or a registry entry. Some may even suggest using a variable but unless both macros were called by a 'top level' macro you would need to use the Save Variables and Restore Variables command. Some who have used these have had difficulties.

Link to comment
Share on other sites

Yes, this is how I would approach the task.

 

One macro cannot directly stop another. However, a second macro can set an 'external something' that the first macro interprets that it is time to stop. This 'external something' can be a file or a registry entry. Some may even suggest using a variable but unless both macros were called by a 'top level' macro you would need to use the Save Variables and Restore Variables command. Some who have used these have had difficulties.

 

 

i just added a time check at the beginning of the overhead macro, and then add another one to break the page that it would be looking at to get info. I will go back later and add a more detail time check later, just wanted to get it up and going now and see if there was a way to do it with a single command.

 

thanks for the helps guys.

 

MBone

Link to comment
Share on other sites

What's wrong with the Mouse to Tray? Works fine, the extra macro is two lines and that's it. The read/write method is fine for stopping specific macros (macros without the extra code will continue to run). The idea was to stop all and Mouse to Tray does it so easily.

I use this on one of my production computers and Forest moves into different spots depending on what i have running at the time.

I missed that one before or i would have address it as it did come across the ways to stop it but that Forest is not always running in the same location.

 

MBone

Link to comment
Share on other sites

I use this on one of my production computers and Forest moves into different spots depending on what i have running at the time.

I missed that one before or i would have address it as it did come across the ways to stop it but that Forest is not always running in the same location.MBone

 

Check out the Mouse to Tray command. The only proviso is that it has to be Visible for the stop to work.

Link to comment
Share on other sites

Check out the Mouse to Tray command. The only proviso is that it has to be Visible for the stop to work.

i changed to not hiding icons a while back, i would grab it at the wrong time and mess up program.

 

 

<MOVE MOUSE TO TRAY ICON Icon="Macro Express Pro - mouse to tray" Exact="FALSE" Center="TRUE" Left="0" Top="0"/>
<DELAY Flags="\x01" Time="5"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="5"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x01" Time="5"/>

 

i used this to find it but, i cant get it to work even if i use the selection.

 

any suggestions.

Link to comment
Share on other sites

i changed to not hiding icons a while back, i would grab it at the wrong time and mess up program.

 

Here's the code I used:

 

Move Mouse to Tray Icon to Macro Express Pro - Macros currently running
Mouse Right Click

 

<MOVE MOUSE TO TRAY ICON Icon="Macro Express Pro - Macros currently running" Exact="FALSE" Center="TRUE" Left="0" Top="0"/>
<MOUSE RIGHT CLICK/>

 

I did not check how it works with macros running from multiple Macro Files. I simaltaneously ran 3 macros out of one file for testing.

Link to comment
Share on other sites

While on the subject of leaving messages for running macros, you could make this into quite a sophisticated setup. Each macro could append a short text string (say to a text file), the first 4 letters of the name, modified if there are conflicts, maybe each in quotes so no recognizable strings are created by adjoining names. The stored string is added to by every joining macro. When each macro checks the file, it uses "If Contains..." to determine whether to stop.

 

If the control macro(s) has to stop a macro, it access the text string, replaces the macro shortname with nothing and saves the new string back to the text file.

 

To bring in another thread, you could then have a macro that read the text string and displayed a list of running macros (taking into account affecting running macros by its presence).

Link to comment
Share on other sites

There's another good thing to point out regarding using an external file to control this: There may be instances where stopping a macro in some random spot causes problems. For instance, if you have a macro that writes files for some other process you probably don't want those files half-written. If each macro looks for a stop signal in some external file then you can accurately control exactly when a macro becomes eligible for stopping. (In this example, check for the stop signal only after completing the writing of the file it's working on.)

 

This is far more elegant than doing something that tells everything, "Drop whatever you're doing, no matter the consequences, right now, and die."

 

w

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...