Sample Scripts/Utilities shipped with FrameMaker 10

ExtendScriptFrameMakerProductsTechnical Communication Suite

Hello Framers,

This blog post is to share a few utilities written by the engineers of the FrameMaker Team. These scripts & utilities had been developed by engineering for internal use but on a later stage it was decided to ship it for the end-user with FrameMaker 10. These are present in FrameMaker 10 installation folder (a folder named $FMHOME\Samples\ScriptsAndUtilities). These simple scripts/utilities (described briefly in the table below) could be used:

  • Either to get started with ExtendScript
  • Or as live examples for solving a workflow


List of Scripts/Utilities

Folder Name


Brief Note

Hello World


Simplest script – Just to get started with ExtendScript! More here

Conditional Text


Create several PDF outputs from a single-source based on the conditional text. NEEDS CUSTOM EDITING. (Attached modified .jsx file with modifications – FM_Outputs_CondText)

  • Specific Conditional Text is shown/hidden
  • PDF is generated

Flatten Conrefs


This script flattens all the conrefs present in all the topic refs of the Active Ditamap/Topic (ditamap needs to be open in document view)

Hierarchical Books


Traverses through a hierarchical book structure.

  • An example to traverse the Folder and Group hierarchy.
  • Creates log of the traversal in a text file.

Read XML


An example to show how to read the elements’ content in an XML file. Exhibits node by node traversal.

Suppress Alerts


A useful script to suppress all alerts. This script uses notifications to suppress all FrameMaker alerts.



The client opens all components of the book-in-focus and washes them via MIF:

  • Save them as MIFs
  • Save the MIFs back to .FM


We had added usage instructions in the Scripts/Clients (but you know how internally used code is like …). We hope these would be helpful!

Download Zip File: ScriptsAndUtilities

ExtendScript, FrameMaker, Products, Technical Communication Suite

Posted on 03-17-2011


  • By Franz J. Gigler - 2:07 PM on December 1, 2016   Reply

    at FM_Outputs_CondText: I’ve finally managed to get my books updated properly after the conditional text settings were applied and before the PDF is written but how on earth can I tell my system to use A4 instead of Letter as the paper Format of the output PDF? Any ideas?

  • By Robert - 12:25 PM on September 22, 2016   Reply

    Hi, the BookMIFWash folder contains a dll, how do I call this from FM?

  • By Matthias Nietert - 3:24 PM on March 20, 2014   Reply

    Is there a version from BookMIFWash for Framemaker 11 available?

    Actually I need script to convert automatically all fm files in a folder into mif files. We have to translate often FM11 files and the transaltion software only works with mif files. So I have to open each fm files and save them afterwards as mif 11 file.

  • By Kevin MacDowell - 11:02 PM on October 23, 2012   Reply

    Amit, thanks for the scripts! What do you mean by “wash” ? BTW you have the same name as someone I worked for in San Diego, CA and Bangalore.

    • By amagarwa - 5:28 AM on May 29, 2013   Reply

      Thanks Kevin! Amit is the most common name here in the region I live in India. 🙂

      The “wash” here means cleaning the FM files of the inconsistencies that might have creeped in, during complex operations, if any. MIF wash has been seen to correct the FM files of its errors.

  • By Serge Menard - 7:51 PM on July 26, 2012   Reply

    Hi, I used the BookMIFWash utility to convert to FM 10 and it worked A1 at the book level. Unfortunately it doesn’t wash the referenced insets found in the FM files in the book. Is there a way to do that using BookMIFWash or another script or utility. Thanks 

    • By amagarwa - 5:28 AM on May 29, 2013   Reply

      As of now, this utility doesn’t wash the insets.

      You may try making insets part of the book (temporarily), the insets might get mif-washed in the process.

  • By Dave - 12:51 AM on April 13, 2012   Reply

    Would it be too much to ask for you lot to post a link to download the files you are talking about?

    • By amagarwa - 5:18 AM on May 29, 2013   Reply

      The blog has been updated with a downloadable zip file.

  • By Brian E. - 1:30 PM on June 7, 2011   Reply


    I’m having a problem where when I run FM_Outputs_CondText.jsx from within the ExtendScript editor I always get the error: “GetOpenDefaultParams is not a function” on the first line within the OpenBook() function.
    Yet when I run the same script from within FrameMaker it runs just fine. Is there something I need to do to get the ExtendScript Toolkit to recognize this is a valid function for a FrameMaker script?


    • By Brian E. - 2:09 PM on June 7, 2011   Reply

      Aha. Hadn’t selected the target application in the dropdown. Is there a way to get it to remember that so I don’t have to change it every time I open ExtendScript?

      • By Rick Quatro - 3:11 PM on July 15, 2011   Reply

        Put this as the first line of your script:

        #target FrameMaker

  • By Ian Saunders - 2:29 PM on May 4, 2011   Reply


    I have just installed Frame 10. My BookMIFWash folder does not contain the corresponding script. There are scripts in all the other script folders. How can I get a copy of this script?

    • By Amit Agarwal - 11:25 AM on May 5, 2011   Reply

      Hi Ian,

      The BookMIFWash folder doesn’t contain the extendscript but the API client (FDK client). Also the folder has its client compiled as a .dll that is ready to use (just add an entry in maker.ini).


  • By Amit Agarwal - 6:41 AM on March 30, 2011   Reply

    Hi Elena,

    There are 2 scripts in the Conditional Text folder:
    1. FM_Outputs_CondText.jsx
    2. FM_Outputs_CondText_XML.jsx

    Both of them do the same task of producing PDF based on the specified conditional tags.

    In Script1, one can specify the tags to Show/Hide WITHIN the script.
    whereas in Script2, the specification of tags has been moved to an XML file (data.xml)

    Each output to be generated has its show/hide tag list that needs to be defined in these statements (one may add more too):

    ShowList[0] = new Array("Comment", "Red");
    HideList[0] = new Array("Blue", "Green");

    And the output names here (one may add more outputs separated by comma):

    var OutPutFiles = new Array("_Comment_Red.pdf", "_Blue_Green.pdf");

    Has 2 tags for each PDF to be produced. Each output tag can have its & tag list (one may add more tags too)

    And regarding the update book function try using:


    before the SavePDF function.

    For Show/Hide I have used: CondFmtId.CondFmtIsShown = 1 or 0

    Let me know if you have more queries. In fact, I would add these to the main blog later to make it more informative.

    • By Elena C - 4:23 PM on March 30, 2011   Reply

      Hi Amit,

      many thanks for the answers!

      I’m using FM_Outputs_CondText.jsx for now.
      What I also needed to adjust, were the destination folder and the names of the generated files. So I added something like this:


      Changed the line about the names:

      var OutPutFiles = new Array("first_conditioned.pdf", "second_conditioned.pdf");

      And finally changed the arguments of the SavePdf function:

      SavePdf(FileSource,OutputPath + OutPutFiles[output_no]);

      Now I don’t need to move or rename the generated files. They are saved directly where I need them.

      The update function works fine. (I have a problem which might be off topic here: how do I set a condition to an entire file in a book? I applied the condition to the content of the file, but when I generate the PDF with the hidden condition, the chapters are not numbered correctly. The “hidden” chapter number is just missing. For the moment I’m using a second book, containing the same files, except that one … but it’s not that efficient, is it?)

      Regarding the other function: CondFmtId.CondFmtIsShown = 1 or 0 activates or deactivates the condition itself. Or at least, that’s what I noticed, switching between 1 and 0.
      I need your help with finding the function for hiding the condition indicators, meaning the color (red, green …) or whatever formatting the writer would use, to mark the conditional texts. Right now, my generated PDFs contain red or green text.

      Thanks again for your time!

      • By Amit Agarwal - 5:29 AM on March 31, 2011   Reply

        Great! you made the script work for you!

        One may use the command below to hide the color indicators in the OpenBookFiles() function: (attaching the modified script in main blog)
        fileId.ShowCondIndicators = 0;

        Regarding the chapter numbers not being numbered properly, it should have been solved by the SimpleGenerate() function. If you still facing the issue do send me small set of your files at amagarwa at adobe dot com

  • By Elena C - 3:00 PM on March 29, 2011   Reply

    I’m new to ExtendScript, but I tried the “Conditional Text” script, which generated two PDFs out of an FM10 book with two conditions. Unfortunately, I think the script is missing a function to update the book, after show/hiding each condition, which leads to generating the PDFs with empty pages and false numbering.
    I could not find a list of FrameMaker functions, nor could I find an update function in other scripts. Could you please tell us what to add to the “Conditional Text” script, to make sure the open book is updated, before generating each PDF? It would also be great to know the function for hiding the condition indicators.
    Thanks a lot for sharing the scripts.

Join the discussion