Sample Script

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:

<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>
Note: When generating a PDF, you can use the saveas or print elements. However, only the print element provides attributes that let you specify various document properties as well as enabling the Generate Acrobat Data option.