Macro conflict prevents a different macro from running.

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
ptotheritchett
Newbie
Posts: 1
Joined: Fri Sep 22, 2006 4:16 pm

Macro conflict prevents a different macro from running.

Post by ptotheritchett » Fri Sep 22, 2006 4:23 pm

I've got two macros that manipulate Access databases.

The first macro repeats itself every two minutes all day, every day. It is very short and does not cause any interference with any other macros.

Then I've got another macro that runs at 7am every day. This macro takes longer to run as the databases get larger near the end of the year.

For some reason, this 7am macro causes the schedule of the first macro to stop at 7:08am. I've looked at the log files and there's no indication why this would be. Is it possible to create a macro that I can run to reset the schedule of a different macro? That would be a great help.
Colorless green ideas sleep furiously.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Sep 22, 2006 8:09 pm

The following possibility is untested, but I think the theory is sound.

The scheduling info is in the macros.dat file in the Macro Scheduler folder. You could modify the line for that affected macro in macros.dat to change the time and/or conditions. I have no time to do that now, but toss the idea out for consideration. Maybe you can take it from there.

At one time I did make a "map" of the data fields for the macros.dat file, but I cannot say right now which fields you need to look at.

But before doing that, you should probably review the settings you have for the macro schedules now and see if you can change the defaults so you don't need to do a dynamic change. Have you tried "Run Immediately If Schedule Was Missed" ?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Sep 22, 2006 8:36 pm

Back in May 2006, I posted a script that displays the Macro.dat info here.

Another idea would be to write one script that controls both scripts using the macro> command. The master script would run the first script every 2 minutes and the second script every day at 7am thus preventing the two scripts from running simultaneously. I assume the simultaneous access of Access is the problem.

Here's a sample to demonstrate what I'm talking about.

Later,
Dick

Code: Select all

Let>7amflag=0

Label>start
Hour>hh
Min>mm

If>{(%mm%=00)or(%mm%=01)or(%mm%=02)or(%mm%=03)and(%hh%=07)and(%7amflag%=0)},run7am
If>%hh%=08
  Let>7amflag=0
EndIf
macro>path+every2minute_scriptname.scp
wait>120
goto>start

Label>run7am
Let>7amflag=1
macro>path+7am_scriptname.scp
goto>start

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Sep 22, 2006 9:41 pm

Thanks for that link, JRL.

I don't know how I missed that, I am here every day! I had made a list some years ago, and know it is around somewhere, but I will check out the info you provided.

And from that link, it sounds like my idea of editing the file might be OK, but would require that Macro Scheduler be stopped and reloaded to read the modified file, so my suggestion may not work. I told you it was untested!


Thanks again Dick, for all you do here.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Sep 23, 2006 1:00 am

Hello Dick.

Thanks lots for the MacroDat Reader script. I just downloaded the "green version".

Like a dummy, I just tried to run it without reading it. Oops, would not run, but definitely not your fault. I had to modify the line where macros.dat was stored vs. %script_dir%. Since my scripts are not on local machine I had to modify to use left portion of %command_line%.

Aah, this is neat, great work.

With some modification I can use this to single step through any dabatase ascii dump. Thanks for letting me add this to my toolbox.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Sat Sep 23, 2006 1:34 am

I'm glad you like it.

Hopefully, with 400 + hits that post had before today, not everyone that tried to use it was frustrated. Today, I turned off HTML and after reposting, it looked good.... Until I logged out as me and went to look at it as a "guest". Then the script was all wrong again. Finally I removed the textarea and turned the script green to differentiate the script from the text.

Later,
Dick

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts