Modifying Markers in FrameMaker at Book level through ExtendScript

Friday, November 16 2012 @ 11:32 AM, By Vikash Kumar

Hello Framers,

In this blog post , we will talk about an ExtendScript which updates marker text of a particular type by iterating over all the components of a book. This example script again reinforces the notion of ExtendScript being very handy for doing repetitive tasks in FM or doing some little enhancements over the existing features.


The script takes 3 parameters from the user.First it prompts the user for the marker type which needs to be updated. Then it prompts the user for the marker text which needs to be replaced. It cab be a substring of the original marker string of the complete marker string itself. Lastly , it asks for the updated marker text with which the original marker text needs to be replaced. After this , it opens the components of the book one by one, updates the marker string of that particular type and then closes the document after saving. At last it gives an alert to the user stating the numbers of markers which have been updated.


Download the attached script and the sample files from here and unzip the package. Open the sample book and make  sure that the book is in focus while  running the script .Give the marker type for example  as “Index” , text to be replaced as “gyan” and the new text as “new gyan”. At last it will give an alert stating the number of markers which have been updated.

Feel free to modify this script according to your own requirements.

Happy Scripting!!

Vikash Kumar

FM Engineering team


  • By bwait - 12:27 AM on November 25, 2012  

    I am new to ExtendScript. Is it difficult to open chapters in a book and split each chapter into separate files based on a heading level? Is there an existing script out there to do this?

  • By Winfried - 8:11 AM on November 19, 2012  


    In my short test this script found strings in marker text only, if the string starts the marker text.
    If there are other words before the search string, the string will not be found.

    Generally I would prefer, if scripts would be intelligent, to process not only books, but also single files.

    Best regards


  • Categories

  • Archives

  • Authors

  • Useful Links

  • Recent Comments

    • Stefan Gentz: Meanwhile RoboHelp (2015 Release) – Update 2 has been released:
    • Stefan Gentz: Meanwhile FrameMaker (2015 Release) – Update 2 has been released:
    • Dieter Gust: So I found it out myself: C:\Program Files (x86)\Adobe\AdobeFrameMaker201 5\fminit\ditafm\DITA-OT\doc...
    • Dieter Gust: In the DITA-OT 2.1 version a rudimentary HTML5 output is included. Add the following entries in...
    • Dieter Gust: Which fonts do you recommend for Thai and Farsi? As far as I can see special Adobe fonts for these...