Run Macro
This function is also available on the Home tab, in the Macro group and (when a Macro file is open) on the File Editor tab, in the Macro group.
To run a macro:
- Setup the forms that will be accessed by the macro and save them. See: Forms & Macros
- Create a macro file containing instructions to call those forms. See: New Macro
- In the Run Macro form, enter the names of all the macro or macro package files you want to execute. They will be processed in the order you enter them.Use the buttons on the local toolbar to Manage the rows in the list.
- Select the Start At button to indicate the file at which you want to begin. All the files before it will be ignored.
- Enter the name of the (.MOF) Report file where you want to store the results of this run. A new file. You should check this file after the macro has run, to see if there were any problems during the execution. On the Script tab, in the Macros group, click Report. If you right click in the Report field with a report selected, the report file will open.
- To minimise the Run Macro form to an icon during the execution of the macro, select Run minimised.
- To abort the macro in the event of an error, select Abort on error.
- Click Run and the macros will be processed.
This sets the default behaviour when the macro starts (the use of an ABORT command in the macro may override it). If an error occurs, a "Macro aborted by user" message is written to the Report file.
When you run a macro, or a Macro Package, you do not run the file itself, but call the file from the Run Macro form.
You can include multiple macro and macro package files in the one run. You can also skip the first entries in the list and execute from a certain step onwards.
Each macro file will contain several instructions. This allows you to create smaller files, which are easier to test, and then combine them to create complex operations.
Macro packages may also be called from other macro packages.
When a macro package is run directly, the macro in the package, and any referenced form sets, are extracted to a temporary location. Unless you explicitly save the forms after running the macro package, they will be discarded when you close the project or exit the application.
Start Process
The run will commence at the first instruction in the macro file adjacent to the Start At button. However, if you want to start the process part way through a macro file, you can enter a value in the Start process prompt. The number you enter in Start process corresponds to the number of a record in the first macro file that will be used in the run.
If you enter a number that is greater than the number of instructions (records) in the start macro file, the entire process will begin from the next macro or macro package file.
If the process is interrupted, the number of the next instruction to be executed will be displayed in the Start process response. The process will recommence from that point.
End Process
The End process value allows you to stop (exit) the macro execution before the end of the macro file is reached. The number you enter in End process corresponds to the number of a record in the last macro or macro package file that will be used in the run.
Run minimized
Select the Run minimized check box if you want the macro task to run in the background.
On completion
Select the action to be performed after the macro task has completed. Leave the drop down blank to take no action.