This sample script shows how simple it is to automate processing in FrameMaker.
The following sample AutoFM script file is an example of a script that can be used to automate the creation of a FrameMaker book and PDF from a DITA map using DITA-FMx (the FMx-Auto “addon” is required to unlock the API in DITA-FMx). This is a description of the process defined by the XML script:
<file> element opens the XML file named dita\sample.ditamap using the structure application named DITA-FMx-Map-1.2
<action> element runs an FDK client named “ditafmx” and passes the specified arguments to that client (note that the syntax and format of the args element is defined by the client application)
<book> element selects the book file that was just created by the FDK client, then saves it, then does a Save As PDF to sample.pdf, then closes the book file
<file> element selects the original DITA map and closes it
<exit> element closes FrameMaker (after closing any other files that may be open)
<autofm> <file> <open type = "XML"> <name>dita\sample.ditamap</name> <appname>DITA-FMx-Map-1.2</appname> </open> </file> <action> <fdk> <client>ditafmx</client> <args>MapToBook|.|DITA-FMx-Book-1.2|..\book\sample.book</args> </fdk> </action> <book> <select> <name>book\sample.book</name> </select> <save/> <saveas type = "PDF"> <name>sample.pdf</name> </saveas> <close/> </book> <file> <select> <name>dita\sample.ditamap</name> </select> <close/> </file> <exit/> </autofm>