32.4.2.2 Understanding how system commands work
When you assign a system command or a macro to a Book*Command or File*Command in the [BookFileCommands] section, Mif2Go generates one or more lines of code, each of which is a command to be run at a Windows command prompt. Mif2Go writes these lines to a .bat file whose name is one of the following:
To make the commands in the .bat file (and the system responses) visible in a Windows command-prompt window while the conversion is running:
; Keep (show until user dismisses),
; Show (during execution only)
; FileCommandWindow = Hide (default), Keep, or Show,
If BookCommandWindow=Show or Keep, @ECHO ON causes the rest of the commands in the .bat file to be visible as they are executed. As the .bat file runs, you see each command and its response. If there is an error, you see the error message even before the Running batfilename line, an unavoidable Windows feature (because stderr cannot be redirected to stdout).
If BookCommandWindow=Show or Keep, the next line in the .bat file after your system commands is:
If BookCommandWindow=Keep, the .bat file ends with:
so that you can see what happened.
Do not specify BookCommandWindow=Keep for unattended use, because the .bat file would wait forever for you to press a key. |
The .bat file remains in the project folder, so you can see what it contains. The next time you run the same kind of command, Mif2Go recycles the .bat file.
> 32 Automating Mif2Go conversions > 32.4 Automating conversion workflow > 32.4.2 Executing system commands before and after conversion > 32.4.2.2 Understanding how system commands work
