I want to check to see if another Macro is running before starting a different Macro.
Along the lines of IFMacroRunning>"Macro A", Do this(True), Start Macro B(False)
Can anyone help with the correct syntax.
Thanks
Richard
Testing to see if another Macro is running
Moderators: JRL, Dorian (MJT support)
Have MacroA update a flag in an INI file when it starts. MacroB checks this value and if set does -this- and if not does -that-. MacroA resets the flag on exit.
This solution was given in this topic:
http://www.mjtnet.com/forum/viewtopic.p ... eadinifile
MacroA:
EditIniFile>status.ini,MacroA,Status,Running
.
. whatever
.
Label>Done
EditIniFile>status.ini,MacroA,Status,Idle
MacroB:
ReadIniFile>status.ini,MacroA,Status,status
IF>status=Running
do -this-
Else
do -that-
EndIf
HTH
This solution was given in this topic:
http://www.mjtnet.com/forum/viewtopic.p ... eadinifile
MacroA:
EditIniFile>status.ini,MacroA,Status,Running
.
. whatever
.
Label>Done
EditIniFile>status.ini,MacroA,Status,Idle
MacroB:
ReadIniFile>status.ini,MacroA,Status,status
IF>status=Running
do -this-
Else
do -that-
EndIf
HTH
MJT Net Support
[email protected]
[email protected]
I have created a status.ini file,
[MacroA]
Status=Idle
Idle=Running
[MacroB]
Status=Idle
[MacroC]
Status=Idle
but I am finding a line being inserted: Idle=Running !! Using the following code
ReadIniFile>status.ini,MacroA,Status,state
IF>state=Running,NoRun
EditIniFile>status.ini,MacroA,Status,Running
...
Label>NoRun
Im not sure where I'm going wrong here.
[MacroA]
Status=Idle
Idle=Running
[MacroB]
Status=Idle
[MacroC]
Status=Idle
but I am finding a line being inserted: Idle=Running !! Using the following code
ReadIniFile>status.ini,MacroA,Status,state
IF>state=Running,NoRun
EditIniFile>status.ini,MacroA,Status,Running
...
Label>NoRun
Im not sure where I'm going wrong here.
Nothing wrong with the code you have posted. But perhaps you have created a variable called Status and set it to Idle before the EditIniFile command. Or maybe you accidentally put State into the EditIniFile command instead of Status. Since State=Idle this would create a setting Idle=Running.
This code works fine:
ReadIniFile>status.ini,MacroA,Status,state
IF>state=Running,NoRun
EditIniFile>status.ini,MacroA,Status,Running
So perhaps you've set Status to Idle instead of state at some point.
This code works fine:
ReadIniFile>status.ini,MacroA,Status,state
IF>state=Running,NoRun
EditIniFile>status.ini,MacroA,Status,Running
So perhaps you've set Status to Idle instead of state at some point.
MJT Net Support
[email protected]
[email protected]