ExtendScript of the Week: Change Styles (Paragraph / Character / Table)


This week in “ExtendScript of the Week” initiative we will showcase an ExtendScript which will Find/Change Paragraph Styles, Character Styles and Table Styles on the body page of the document. This script demonstrates one of the several workflows where ExtendScript can be used to do tasks in an intuitive and easy way. The script works on Book as well as single FrameMaker / MIF files.


Please note that there is a newer version of this script with much improved functionality here.

About this Script

  • On running the script this dialog appears:

    Change Style UI

  • The dialog contains three radio buttons – namely “Para Style”, “Char Style” and “Table Style” and two buttons “Change” and “Cancel”.
  • You can choose the style type to be changed by clicking on the appropriate radio button and the FIND and CHANGE dropdowns are populated by the styles existing in the active document or if run on a book the styles are taken from the first non generated file in the book.
  • E.g., if you run the script on the attached Sample_Book.book/Doc1.fm then choose “Para Style” radio button.
  • Now choose NewParaFormat-Blue in the FIND dropdown.
  • Choose NewParaFormat-Red in the CHANGE dropdown.

    Choose Styles in UI

  • Click on Change button.
  • Now the script will iterate through all paragraphs of all components of the book and wherever the paragraph format is NewParaFormat-Blue, it is changed to NewParaFormat-Red.

    Output File

  • Similarly you can change character formats and table formats in a book or document.
  • After changing the style, an alert will appear informing the user about the number of changes that were done in the operation.

    Number of Changes

Steps to Install

  1. Download the zip file from ChangeStyles
  2. Unzip the files and copy “ChangeStyleMenu.jsx” and “ChangeStyle” folder in startup folder located at “C:\Program Files\Adobe\AdobeFrameMaker10\startup”

How to use the Script

  1. Launch FrameMaker
  2. Open a Book File or FM/MIF File
  3. Run Change Styles from “File -> Utilities -> Change Styles …
  4. This will run the script and ask you for inputs to change the style.
  5. Choose the style to be changed in ‘Find’ dropdown.
  6. Choose the style to be applied in ‘Change’ dropdown.
  7. Click on Change button.
  8. If the script is run on an open FM/MIF file the styles will be changed without saving the document.
  9. If the script is run on a Book, all the FM/MIF components which are closed are opened invisibly, the styles are changed and then the files are closed after saving.

I hope this will prove useful to many folks and you can add extra functionality as per your requirements to these scripts to make it even more powerful.

Bharat Prakash

(Resources: ChangeStyles)

ExtendScript, FrameMaker, Products
Bharat Prakash

Posted on 10-05-2011


  • By Craig Ede - 5:04 PM on November 15, 2012   Reply

    At this point I’ve had the opportunity to try this script in a couple of “real world” situations, and I have to say, it is very hit and miss. Something is very wrong with this script since it actually changes only a fraction of the total occurances of a paragraph tag to the new tag and ignores other occurances. I expect the problem is in how it is stepping through the paragraphs and deciding if it is a valid paragraph to change to the new format. Could the writer of the script address this complaint. I’m sure the fix would be instructive to all of us who are interested in Extendscript scripting in FrameMaker.

  • By craigede - 1:34 PM on November 1, 2012   Reply

    I tried this script on a document with two paragraphs called Bulleted and BulletedOutdent. At first the script only changed some of the instances (ignoring others). Finally, it saw none of the Bulleted paragraphs and changed none of them. Bug?

    Also, it would be nice if the menu of paragraph formats were sorted into alphabetical order rather than appearing in some random order.

    I’d be happy to send you the file if you want to look at these problems.

    Thanks you.

    Craig Ede

  • By Steve Olsen - 7:40 PM on February 9, 2012   Reply


    I have multiple documents which need to have character style changes. This saved me hours, and hours, and hours.

    Thank you very much!

  • By Bharat Prakash - 10:18 AM on February 1, 2012   Reply

    Hi Anh,

    I have fixed the issue and mailed you the updated scripts. Kindly let me know if there are any more issues.

    Bharat Prakash(bharatp@adobe.com)
    FrameMaker Engineering

  • By Anh Gauthier - 2:33 PM on January 31, 2012   Reply

    I’m having trouble changing paragraph tags. It works in the sample fine. But when I use it on my files, it reports that 0 changes have been made when I select valid parameters. Also, in one instance where it does work, it only changes one particular section of an FM file. Any suggestions on what I should try?

    • By Bharat Prakash - 3:58 PM on January 31, 2012   Reply

      Hi Anh,

      Thanks for using the script. Kindly send me some sample files so that i can isolate the issue.

      Bharat Prakash
      FrameMaker Engineering

  • By Heather Ayer - 5:46 PM on January 27, 2012   Reply

    Thanks for the example. It works beautifully.

    Are there any tips on how to add a paragraph tag first? I have several tables in the doc that were copied in and have been assigned the standard “Table” format. So, in order to change the format, I would first have to add this format to the catalog. Any tips would be greatly appreciated. I’m trying to make the most of this new tool, but there’s not much reference material out there.


    • By Bharat Prakash - 3:57 PM on January 31, 2012   Reply

      Hi Heather,

      Thanks for the feedback. Right now the script works on the tags already added to the catalog so if you are copying content from other files , the tags have to be added manually.

      Better method would be Importing formats between documents through File>Import>Formats…

      Hope this helps. Kindly let me know if you have any more questions.

      Bharat Prakash(bharatp@adobe.com)
      FrameMaker Engineering

  • […] Skript dieser Woche von Adobe sieht zunächst so aus, als hätte das Team sich Rick Quatros Plug-in FindChangeSpecial […]

  • By Michael Müller-Hillebrand - 6:30 PM on October 11, 2011   Reply


    The sample files in the download are apparently saved from FrameMaker 11.

    – Michael

    • By bharatp - 6:13 AM on October 12, 2011   Reply

      Hi Michael,

      I have updated the samples files to FM10 version. I have also fixed the bug regarding not being able to type lowercase u letter.
      Kindly download the files now(Same link) and try running them.

      Bharat Prakash

Join the discussion