Jump to content
Macro Express Forums

How can I create scheduled macro at the exact seconds level?


Recommended Posts

I'd like to run macro at the exact time including seconds, for example, 7:59:58

But I found that ME Pro doesn't allow setting seconds when creating scheduled macro, as below.

Run the macro : Daily

Run at : PM 7:59

 

Is there any way to set the seconds? This, setting seconds, is important to my task.

 

Thanks in advance.

Link to comment
Share on other sites

I'd like to run macro at the exact time including seconds, for example, 7:59:58

But I found that ME Pro doesn't allow setting seconds when creating scheduled macro, as below.

Run the macro : Daily

Run at : PM 7:59

 

Is there any way to set the seconds? This, setting seconds, is important to my task.

 

Thanks in advance.

Welcome to the forum.

 

Let's say you have the "MAIN" macro you want to run at 7:59:58

 

1. Create a scheduled macro "X" that will be run at 7:58 (NOTE: 7:58, not 7:59)

2. The macro "X" will wait until system time (only minutes and seconds) equals 59:58

3. At that time the macro "X" will use the Macro run command to run the MAIN macro.

 

<REPEAT UNTIL Variable="%T[1]%" Condition="\x00" Value="59:58"/>
<DATE/TIME Format="nn:ss" Flags="\xB0" Date="2010-11-21 09:39:57" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="0" Variable="%T[1]%" IsDateVar="FALSE"/>
<END REPEAT/>
<MACRO RUN Use_ID="FALSE" Name="THE MAIN MACRO" ID="-1" Wait="FALSE"/>

 

Why not only check seconds? Here's a reason. Scheduled macros are run with some random delays. So, a macro scheduled for 7:59 will actually be run at about 7:59:07. And if you were checking for 59:02 - you would've missed it). The delay differs on my machine. Sometimes it's 2 seconds, sometimes it's 10. So, even if you wanted to run a macro at 7:59:00 (7:59:00 = 7:59) - you actually couldn't, because of the delay. This is also the reason you can't create macro "X" that will be run at 7:59, wait 58 sec, and then run the MAIN macro, because the MAIN macro in this case would be run at about 8:00:02.

 

 

Hope this helps :)

Link to comment
Share on other sites

@Koon: You are correct in your observation that seconds cannot be set for a scheduled macro. There needs to be a balance between how much of your CPU is used by Macro Express and how frequently things get checked. If Macro Express were to was continually check to see if a scheduled macro should run, it would use much more of the CPU and possibly slow down your other tasks. The technique described by arekowczarek is a good way around it. But be aware that checking that frequently will will use more CPU cycles and, depending on your system, may affect other programs.

 

@arekowczarek: By default, Macro Express checks every 10 seconds to see if a scheduled macro should run. If the scheduler just checked and one second later the scheduled macro could have run, it will run when the scheduler next checks, 9 seconds later. This may result in the perception that the scheduled macros have a random delay.

 

You can adjust scheduled macro Timer Interval by clicking Options, Preferences, Activations, Scheduler. Change 'Check the scheduled macros every [ ] seconds' box to 1 second. However, this will use more CPU cycles and, on some systems, may slow down other processes.

Link to comment
Share on other sites

@arekowczarek: By default, Macro Express checks every 10 seconds to see if a scheduled macro should run. If the scheduler just checked and one second later the scheduled macro could have run, it will run when the scheduler next checks, 9 seconds later. This may result in the perception that the scheduled macros have a random delay.

 

You can adjust scheduled macro Timer Interval by clicking Options, Preferences, Activations, Scheduler. Change 'Check the scheduled macros every [ ] seconds' box to 1 second. However, this will use more CPU cycles and, on some systems, may slow down other processes.

I figured the random delays were somehow connected to the frequency ME checks for scheduled macros. Didn't know I could adjust it in the Preferences, (probably because I don't use scheduled macros at all so the delays are of no significance to me). Good to know anyway, might use this info in the future.

Link to comment
Share on other sites

You can use the Windows Task Scheduler to get down to the second. Actually there are many excellent benefits for using the built in Windows Scheduler. For instance you have more trigger and condition options like being able to run only if a certain amount of idle time has elapsed. Great for CPU or GUI intensive tasks you would like to run 'whenever' but not when you're trying to meet a deadline. But the coolest I think is being able to wake up the PC to perform the task because I like to sleep my PC when not in use to save power.

 

To run a macro from the "Run" line use MEProc. It takes the same command line arguments as MEP but will check to see if MEP is running first and if it is simply instruct it to run the macro you specify. EG a macro named "My Macro" would have a command line of "C:\Program Files (x86)\Macro Express Pro\MEProc.exe /AMy Macro". The slash A switch executes a macro by that name.

 

 

Link to comment
Share on other sites

You can use the Windows Task Scheduler to get down to the second.

I don't have access to Vista or Win 7 that you use Cory, but on Win XP I can only adjust the scheduled time down to the minute.

If Koon is running a Windows 7 or Vista (if the second level accuracy applies for Vista too) then your idea is way better than mine. And he probably is cause XP is "a little" out-dated and only stubborn people like myself keep on using it :)

Link to comment
Share on other sites

You can use the Windows Task Scheduler to get down to the second. Actually there are many excellent benefits for using the built in Windows Scheduler. For instance you have more trigger and condition options like being able to run only if a certain amount of idle time has elapsed. Great for CPU or GUI intensive tasks you would like to run 'whenever' but not when you're trying to meet a deadline. But the coolest I think is being able to wake up the PC to perform the task because I like to sleep my PC when not in use to save power.

But you need to be aware that if you are logged out (i.e. you need to retype your password when the machine wakes), many/most macros will not run.

In which case, there is a separate technique that can be used, where the computer is automatically rebooted to login without having the user type a password, then runs the scheduled macro, then reverts the computer to requiring a user login, and finally returns to computer to its sleep/standby/hibernate status.

Link to comment
Share on other sites

I checked my VM for XP and you're right, you can't specify seconds in it. Just one more reason 7 is better.

 

Honestly I don't understand the allegiance folks have to the old OS. I work on user machines as old as 2000 Pro and I always find it frustrating when I have to spend any time on them. Hell, the new taskbar alone make it worth it to me. I've asked many times why people stick with it and I haven't' found a valid reason yet. Granted it does cost to upgrade but I reckon it pays for itself in a week's worth of increased productivity. Oh, and all the bundled features and free add-in apps means there are very few things an ordinary user has to buy anymore. EG drive imaging is now a feature of the backup software so I don't need to pay Symantec more to update my copy of Ghost. I think people tend to stick with what's comfortable and at the rate technology changes these days that's understandable. But XP is getting to be a pretty old dog now. I mean it is a decade old now...

 

 

Link to comment
Share on other sites

I checked my VM for XP and you're right, you can't specify seconds in it. Just one more reason 7 is better.

The reason I never switched to win 7 is that my Tetris macro only runs on win XP :D

 

Now seriously. I was considering switching to win 7 when it was released last year. However a friend of mine that already was using it said that ME doesn't work right on it. Among other things, reading a pixel color off the screen was taking considerably longer (it was by no means hardware issue). I don't remember whether it was ME 3.x or ME PRO. Anyway, since I read pixels on daily basis I decided to stick to XP until a performance fix is applied. I never really got around this problem later, don't know whether it was the OS fault or ME compatibility issue, quite sure it's long gone now, isn't it?

Another thing that keeps me from changng the OS is I have loads of macros that would need slight (but still) adjustments to work with any new OS UI. I just don't have time to do it.

Link to comment
Share on other sites

drive imaging is now a feature of the backup software so I don't need to pay Symantec more to update my copy of Ghost.

If using Windows 7's Backup utility, make very sure that you are able to restore from it. Unknown to me, Windows 7 scheduled a backup job to run weekly. My backup media is external and therefore not always available. When Windows 7 tried to run the scheduled backup, the external media drive was unavailable, and my entire backup catalog was corrupted, to the extent that the backup I had made earlier was useless.

Link to comment
Share on other sites

I use 7 and MEP works great. I think I was the one who discovered the slow Get Pixel Color in the beta days and I don't know if it was ever fixed. If I remember it was the Aero interface that was causing the problem and if it was disabled they ran normal speed.

 

Windows 7 comes with XP Mode. Essentially it's Microsoft's Virtual PC software with a free license of XP. I use Virtual PC all the time as I often develop macros for clients in XP, 2000, and other versions of Windows or ones with specific environment requirements. It's a great addition to MEP in many respects but one that's not completely obvious to most is that you can have several open and macros running in them unattended without taking over your machine and making you unproductive. VM's (Virtual Machines) Are for all intent and purposes real machines that have their own IP addresses on the network and everything. I highly recommend any serious macro writer look into it.

Link to comment
Share on other sites

If using Windows 7's Backup utility, make very sure that you are able to restore from it.
Here again I do things a little differently. I use Carbonite for my backups and have had no regrets. Simple to set up, cheaper than physical media backups, requires no routine user actions, and a lot of other little benefits like I can access files in the backup archive from my Android phone. Supposedly I can even listen to my music on my phone but I haven't tried that yet. Soooo many geek things, so little time.
Link to comment
Share on other sites

Windows 7 comes with XP Mode. Essentially it's Microsoft's Virtual PC software with a free license of XP. I use Virtual PC all the time as I often develop macros for clients in XP, 2000, and other versions of Windows or ones with specific environment requirements. It's a great addition to MEP in many respects but one that's not completely obvious to most is that you can have several open and macros running in them unattended without taking over your machine and making you unproductive. VM's (Virtual Machines) Are for all intent and purposes real machines that have their own IP addresses on the network and everything. I highly recommend any serious macro writer look into it.

I have been a VM user for about a year now. But I don't use the MS virtual PC. I was testing it last year and the main problem I encountered - it refused to use graphic card's resources, therefore no gaming on VM was possible. I found VMware Workstation a way better solution for virtualization. Sure it's not free, but at least it works as expected. Even if MS fixed it since then, I will still stick to VMware product, cause there's more configaration options available in it.

Then again, not all macros written for "real" PC will work on a VM. As far as games are concerned (and in my case they are), pixel colors in the VM can vary from the pixel colors on the "real" pc.

So, if I don't need to use a VM, I don't, cause in my case it always requires modifiactions to the macros. Plus using mouse in games run on VM is a disaster... I prefer to turn on another machine and worry about the electricity bill rather than worry about the modifications. That of course only applies to not-so-often used macros. When I had to run a macro 24/7 for a month, I used 4 VMs on one PC, each doing same thing, and it was worth the hassle.

 

I am quite sceptical about the use of Win OS built-in apps. There's always a correspondent (?) application somewhere on the net that is better. It applies to Virtual PC, Remote Desktop, Disk defragmenter, Windows Media "Disaster" Player, and having read what Paul wrote few posts ago, also to the backup utility. Some people could add IE to the list too. Sometimes the correspondent apps are freeware, sometimes they are not, but they are out there.

Link to comment
Share on other sites

Are there any licensing issues?

Licensing, activation and all that are exactly as a real machine. The one exception is that W7 in effect comes with one free license for XP. However I've found that for older OS's I've always had spare license lying about from upgraded machines.
Link to comment
Share on other sites

Licensing, activation and all that are exactly as a real machine. The one exception is that W7 in effect comes with one free license for XP. However I've found that for older OS's I've always had spare license lying about from upgraded machines.

What about any licensing issues for Macro Express?

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