32.4.2.1 Executing a system command
To specify a command or macro to be executed before or after a FrameMaker book is converted (and optionally compiled and/or archived):
; BookStartCommand = command line to run at start of book processing
; BookWrapCommand = command line run at end, before compiling
; BookEndCommand = command line to run at end, after compiling
System commands for single files
To specify a command or macro to be executed before or after a single FrameMaker file is converted:
; FileStartCommand = command line to run at start of file processing
; FileWrapCommand = command line run at end, before compiling
; FileEndCommand = command line run at end, after compiling
System commands for files apply when you are converting a single document file rather than a book; they are similar to the system commands for books, except that you can override file commands in a specific filename.ini; see §31.1 Using a different configuration for selected files.
System commands can include user variables and the following predefined macro variables (see §27.2.4 Using predefined macro variables):
Predefined macro variables other than those listed here do not work in system commands.
You can use macro expressions in system commands: math and string manipulations, conditional expressions, loops, formatted output, and so forth; see §27.5 Using expressions in macros.
You can have Mif2Go prompt you for values of user variables that appear in system commands; see §32.4.3 Supplying run-time values for user variables.
Use forward slashes in file paths
When you specify a file path in a system command, use "/" as the separator character. For example, suppose you want to make a backup copy of your book on another server before you run each conversion, and then copy your result files to another folder:
BookStartCommand = copy <$$_prjpath>/*.fm x:/backup
BookEndCommand = copy <$$_currpath>/*.htm /outcopy
In m2hmacro.ini you can find other examples, such as using system commands to move HTML Help and JavaHelp files.
> 32 Automating Mif2Go conversions > 32.4 Automating conversion workflow > 32.4.2 Executing system commands before and after conversion > 32.4.2.1 Executing a system command
