Jump to content
Macro Express Forums

Scope Question


cyberchief
 Share

Recommended Posts

I run ME on mulitple computers... and control them all on my PC via netmeeting (shared and control desktop). When running programs, I find that I need to modify the macro program. I normally pull up that macro on ME on my desktop, make changes, save, then open up that computer's desktop, and re-open the macro file so that computer sees the changes. I have 4 other computers right now... each with a mex file associated with them (Macro 1.mex, Macro 2.mex, Macro 3.mex, Macro 4.mex). I thought of creating a Macro that will automatically re-open the file. This works... except for the fact that, since ME is running on my desktop, MY ME will run rather than the one on the computer I am controlling. I set the hotkeys for the computers that are running... but my ME mex file does not have that hotkey in use... so it is normally not a problem and the ME on the computer will take the hotkey and run. What I want is a way to create a scope that will run this macro as long as the current mex file is not Main.Mex. Is there a way to do this? To create a scope that will run this macro anytime the current loaded mex file is not "Main.mex"?

 

Here is the code I created:

 

Set Variable %T1% to "Preferences Registry Key"
Read Registry String: "Current File"
If Variable %T2% contains "Macro 1"
 Program Launch: "Macro 1.mex"
Else
 If Variable %T2% contains "Macro 2"
   Program Launch: "Macro 2.mex"
 Else
   If Variable %T2% contains "Macro 3"
     Program Launch: "Macro 3.mex"
   Else
     If Variable %T2% contains "Macro 4"
       Program Launch: "Macro 4.mex"
     Else
       If Variable %T2% contains "Macro 5"
         Program Launch: "Macro 5.mex"
       Else
         If Variable %T2% contains "Main"
         End If
       End If
     End If
   End If
 End If
End If

 

<VSETMISC:T1:Preferences Registry Key><REGRSTR:2:%T1%\Miscellaneous\Current File><IFVAR2:1:02:7:Macro 1><LAUNCHDEL2:0:01Z:\H_Drive\Gba\QMacro\Main Macro File\Macro 1.mex><ELSE><IFVAR2:1:02:7:Macro 2><LAUNCHDEL2:0:01Z:\H_Drive\Gba\QMacro\Main Macro File\Macro 2.mex><ELSE><IFVAR2:1:02:7:Macro 3><LAUNCHDEL2:0:01Z:\H_Drive\Gba\QMacro\Main Macro File\Macro 3.mex><ELSE><IFVAR2:1:02:7:Macro 4><LAUNCHDEL2:0:01Z:\H_Drive\Gba\QMacro\Main Macro File\Macro 4.mex><ELSE><IFVAR2:1:02:7:Macro 5><LAUNCHDEL2:0:01Z:\H_Drive\Gba\QMacro\Main Macro File\Macro 5.mex><ELSE><IFVAR2:1:02:7:Main><ENDIF><ENDIF><ENDIF><ENDIF><ENDIF><ENDIF>

Link to comment
Share on other sites

You cannot keep the macro from activating but you could, within the macro, have it quit without doing anything. Try putting something like this at the top of your macro:

Set Variable %T1% to "Current Macro File"

If Variable %T1% contains "main.mex"

  Macro Stop

If you get a 'Macro Aborted' message from the Macro Stop command you can disable the message using tweakme3 available from http://www.macros.com/downmore.htm or you can use the Macro Return command like this:

  Set Variable %T1% to "Current Macro File"
 If Variable %T1% contains "main.mex"
   Macro Return

Link to comment
Share on other sites

I figured it out for now....

 

The Main.mex file is in a different directory than the macros I am running for the other computers. Main.mex is on the H drive and the others are in the Z drive (both on network). Under Activation, on the window category, I selected the Z drive directory. now, it will run only if the current macro file is under the Z drive. Works fantastic.

 

If anyone still has any ideas as far as scope goes... in the case that the main.mex file is ever under the same directory, please feel free to post ideas.

Link to comment
Share on other sites

Kevin,

 

The problem with your suggestion is that, I have the shared desktop from the other computer which will just be within another window. Activating the hotkey will automatically send it to my computer and the other computer will not take it.

 

Well, although I was able to verify this would work on MY computer... I just tested my work-around on one of the other computers through the shared desktop. It wouldn't work. But, I can right-click RUN on those mex files... so I guess I still accomplished what I needed to do. Just creating a little shortcut rather than going "file, open," and navigating to the correct program. Thanks!

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

×
×
  • Create New...