Jump to content
Macro Express Forums

Command To Auto-disable Macro After Running?


TsunamiZ

Recommended Posts

It would depend on your criteria. If the idea was to run once simply define the schedule that way. Also with the scheduler you can have a macro that runs ever 5 minutes but limit it to be from 9AM to 9PM or whatever. But you can also disable a macro conditionally if you like. For instance you can test to see if a file exists and if it does run the Disable Macro command. Simple.

 

Fair warning, this modifies the macro file and disables for all users! For instance my oft mentioned fax monitor macro can’t use it because if I disable it then it will be disabled for all users. Instead I test to see if the currently logged on user is the chosen one and bail out if it isn’t.

Link to comment
Share on other sites

I'm not 100% sure, Kevin would know better but here's my 2cents. If you disable the screensaver you are in effect disabling the inactivity counter in Windows. This works for many things, not just the screensaver. ME has an option to disable this for you. In this case no mater what is scheduled the system will never go into standby or however you have it configured.

 

Now if a macro runs it appears as activity to the system so it will not go into standby. E.G.: if the macro runs every 5 minutes and the sleep is set to kick in after 10 minutes it will never go to sleep. If the macro doesn't fire, do to the scheduling, it will go into standby.

Link to comment
Share on other sites

... after it finishes running it will disable it to prevent the scheduled macro from conflicting with my PC's standby

 

I think you'll find it's the other way round! When your machine is in standby, or hibernating, none of the macros you schedule using ME's scheduler will run.

 

However:

IF you use the Windows scheduler to fire off your ME macro,

AND assuming it's set to wake your machine,

AND your BIOS can handle this,

it's a different story.

Link to comment
Share on other sites

... after it finishes running it will disable it to prevent the scheduled macro from conflicting with my PC's standby

 

I think you'll find it's the other way round! When your machine is in standby, or hibernating, none of the macros you schedule using ME's scheduler will run.

 

However:

IF you use the Windows scheduler to fire off your ME macro,

AND assuming it's set to wake your machine,

AND your BIOS can handle this,

it's a different story.

but currently scheduling a macro prevents my pc from standby

Link to comment
Share on other sites

Paul: I don't think you understood what I meant. This is assuming that ME is not disabling the inactivity time.

 

I was saying the in effect if a scheduled macro runs it's activity that will keep a machine from going ot sleep. But if you run a macro and have it disable the scheduled macro that macro will never run allowing the machine to go to sleep.

 

I like your ideas about using the Windows Scheduler. I've known this and although I don't think it should be employed in all cases but I definitely see many advantageous applications.

Link to comment
Share on other sites

Now if a macro runs it appears as activity to the system so it will not go into standby. E.G.: if the macro runs every 5 minutes and the sleep is set to kick in after 10 minutes it will never go to sleep. If the macro doesn't fire, do to the scheduling, it will go into standby.

A machine's state of inactivity is quite precisely measured by the period in which no keyboard or mouse activity takes place. Running programs, downloading, etc. - none of these processes counts in terms of stopping an inactive countdown.

Running an ME macro stops this inactive counter ONLY IF that macro moves the mouse or types some text - otherwise the inactive counter is not stopped.

Link to comment
Share on other sites

I disagree. I embarked on an energy saving campaign at one of my clients and after some trouble figured out how to get the machines to go into S3 standby (deep sleep) and set them up so that the only way they would wake is if I fired a magic packet at them. This eliminates any other traffic from waking them. But if ME was running they wouldn’t go into standby. It was my fax monitor macro and all it was did was check to see who the domain user was, compare it to a list saved in the macro and abort. No mouse keyboard or other UI commands. Yet if the macro was scheduled to go off every 10 minutes and the computer set to standby in 1 minute (for testing) the machine would go to sleep. This was verified on a couple of machines. So it was my belief that on a machine with an enabled inactivity timer paid no regard to whether a macro was scheduled or not. It had no effect on the countdown and a machine would go to sleep regardless. My speculation was that it was the disk or network access that occurs every time a macro runs that caused the machine to reset the inactivity counter. As always there may be something I’m missing in all this but I think my experiment was pretty sound in logic so I’m interested in any theory that you might have on this matter as it might have bearing on how I address the standby problem with my client. I know, maybe it’s because I have network sync enabled?

Link to comment
Share on other sites

But if ME was running they wouldn’t go into standby. It was my fax monitor macro and all it was did was check to see who the domain user was, compare it to a list saved in the macro and abort. No mouse keyboard or other UI commands.

Well, to my great surprise, you're almost completely right! Running any macro does indeed stop the machine going into Standby, except if the command you're running is a Timed Delay!

 

This is what I've tried, having set my machine to standby after 1 minute of inactivity.

 

1) Have a macro running, which loops for 5 minutes; in the loop, do a normal delay for 90 seconds. Standby never occurred.

 

2) Have a macro running, which loops for 5 minutes; in the loop, do a timed delay for 90 seconds. Standby occurred after one minute.

 

3) Using a .bat file, loop for ever; in the loop, display a folder with the dir command, then wait for 5 seconds (using VB Script). Standby occurred after one minute.

 

4) Using a .bat file, loop for ever; in the loop, display a folder with the dir command. Standby never occurred.

 

My conclusion? That running a macro occupies enough CPU cycles to prevent standby from taking place. I assume that test 4 also consumes CPU cycles.

 

I've written a quite complex set of ME macros to handle hibernation or standby on my computer, because having the machine hibernate automatically in the usual way interrupts long-running downloads. These macros can detect if downloads are taking place, or whether I am running some specific program (e,g, encoding one or more DVDs). If so, the machine simply tries again later. One advantage of the ME scheduler over the Windows one when specifying inactivity is that ME repeats the attempt to run the macro continuously, whereas the Windows scheduler does not.

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