UNIX Shell Scripts for Commonly Used fmbatch Commands
You can use fmbatch to open, print, reformat, and save Adobe FrameMaker documents without actually displaying them. You can issue commands one at a time (interactively), or you can store commands in a text file (i.e., a batch file) and issue all the commands in a single command. For example, the following batch file contains a sequence of commands that will open FileA, save FileA in MIF format, then close FileA and perform the same operation on FileB.
Open FileA
SaveAs m FileA FileA.mif
Quit FileA
Open FileB
SaveAs m FileB FileB.mif
Quit FileB
After creating a batch file, you run fmbatch from a UNIX command line using the batch file name as an argument:
fmbatch batchfile
The following UNIX shell scripts create batch files you can use with the fmbatch command.
- This script builds a batch file that saves all documents in the present working directory in MIF format. Saving in MIF format is useful when it is necessary to open documents in an earlier version of FrameMaker.
#! /bin/csh -f
# C shell script to build an fmbatch command file that
# saves all documents in the current directory as mif files.
set scriptname = createbatch
set batchfile = commands.batch
rm -f $batchfile >& /dev/null
touch $batchfile
foreach f ( * )
# don't add directories or the batch file
if ( ! -d "$f" && "$f" != "$batchfile" ) then
echo "Open $f" >> $batchfile
echo "echo Saving $f to $f.mif" >> $batchfile
echo "SaveAs m $f $f.mif" >> $batchfile
echo "Quit $f" >> $batchfile
endif
end
echo ""
echo "$scriptname is done. See batchfile in $batchfile."
- This script builds a batch file that saves all documents in the present working directory. It is useful after you've upgraded to a later version of FrameMaker as it circumvents the alert message you would get when opening and saving documents interactively.
#! /bin/csh -f
# C shell script to build an fmbatch command file that opens
# and saves all documents in the current directory.
set scriptname = createbatch
set batchfile = commands.batch
rm -f $batchfile >& /dev/null
touch $batchfile
foreach f ( * )
# don't add directories or the batch file
if ( ! -d "$f" && "$f" != "$batchfile" ) then
echo "Open $f" >> $batchfile
echo "echo Saving $f" >> $batchfile
echo "Save $f" >> $batchfile
echo "Quit $f" >> $batchfile
endif
end
echo ""
echo "$scriptname is done. See batchfile in $batchfile."
- This script prints all documents in the present working directory. It assumes you have print settings file named "SetFile" specified. A print settings file is a FrameMaker document that has been saved with the desired print settings configured in the Print dialog box. If a print settings file is not specified, the print settings of individual the documents will be used when printing. However, a print settings file is very useful when it is desirable to print to a PostScript or PDF file.
#! /bin/csh -f
# C shell script to build an fmbatch command file that opens
# and prints all documents in the current directory.
set scriptname = createbatch
set batchfile = commands.batch
rm -f $batchfile >& /dev/null
touch $batchfile
foreach f ( * )
# don't add directories or the batch file
if ( ! -d "$f" && "$f" != "$batchfile" ) then
echo "Open $f" >> $batchfile
echo "echo Printing $f" >> $batchfile
echo "Print $f SetFile" >> $batchfile
echo "Quit $f" >> $batchfile
endif
end
echo ""
echo "$scriptname is done. See batchfile in $batchfile."
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
