From Other Program
There are several options how to run macro from other programs:
1.Running macro saved in macro file:
It is possible to start macro from other program or using a command line (Windows "Run" dialog box or command prompt window). Just start Macro Toolworks with this parameters:
-run:<NameOfTheMacroToRun> <MacroFilePath>
For example, "C:\Program Files\....\MacroToolworks.exe -run:Update C:\Program Files\....\mymacrofile.4tw
This will cause the macro program is loaded to the memory, opens the file specified in the parameter and runs the defined macro. Then the program exits.
2.Running a macro from currently opened macro file:
If the Macro Toolworks is running with a macro file opened, then it is possible to start a macro from an opened macro file using “RunMacro.exe“ program. It takes macro name as a parameter and causes the macro is executed.
Example: “RunMacro.exe mymacro” will cause the “mymacro” macro is started.
Since both macro program and macro file are already loaded in computer memory the macro execution is significantly faster than case #1 above.
3.Running macro saved in .MCR text file:
It is possible to save macro to a text file with ".mcr" extension (just right-click in macro steps editor and pick the command from menu). Macro that is saved in .MCR file can be started just by double-clicking in the Windows Explorer or other file management program. Running .MCR macro is faster then running the same macro using approach #1 above because it is not necessary to load a macro file (probably with many other macros defined). Note: Subsequent macro calls invoked by Run MACRO (<run>) command from the macro will fail. This means that an .MCR macro should not contain Run MACRO (<run>) command.