Omni Systems, Inc.

  

Mif2Go User's Guide, Version 33u53

  

Valid HTML 4.01!

 

Made with Mif2Go

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


32.4.2.1 Executing a system command

System commands for books

To specify a command or macro to be executed before or after a FrameMaker book is converted (and optionally compiled and/or archived):

[BookFileCommands]

; BookStartCommand = command line to run at start of book processing

; BookWrapCommand = command line run at end, before compiling

;  and archiving

; BookEndCommand = command line to run at end, after compiling

;  and archiving

System commands for single files

To specify a command or macro to be executed before or after a single FrameMaker file is converted:

[BookFileCommands]

; FileStartCommand = command line to run at start of file processing

; FileWrapCommand = command line run at end, before compiling

;  and archiving

; FileEndCommand = command line run at end, after compiling

;  and archiving)

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.

Use macro variables

System commands can include user variables and the following predefined macro variables (see §27.2.4 Using predefined macro variables):

[spacer]

<$$_basename>

Base file name (without path or extension) of the current book or document

<$$_prjpath>

Path (without trailing slash) to the source folder where the .prj file resides

<$$_currpath>

Path (without trailing slash) to the current folder where the configuration file resides

Predefined macro variables other than those listed here do not work in system commands.

Use macro expressions

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.

Prompt for user variables

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:

[BookFileCommands]

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