ExtendScript of the Week: “Deleting Unused formats in a Book”

Wednesday, October 19 2011 @ 12:20 PM, By Vikash Kumar

Continuing with the   “ExtendScript of the Week” series , this week we are providing a script which will delete all the unused formats in a book. The formats to be deleted will be table, paragraph and character.  First of all , unused table formats will be deleted ,followed by unused para formats and lastly unused character formats.

About the Script:

  • It works on the active book in FM session.
  • It will work for the hierarchical book  as well.
  • It iterates over all the book components and silently opens them one by one
  • Deletes the unused formats in the book component in the order mentioned above
  • Saves the document and closes them.
Steps to run the script :
  • Download the script and the test files which has been attached here.
  • Open the book file in FM and make sure that it is active
  • Open the first chapter of the book
  • Open the character, paragraph and table catalogs to see that the document has unused formats. There will be a light check mark against the used formats which distinguishes it from the unused formats
  • Now close the document and run the script
  • An alert will come indicating that the operation has finished
  • Now check the book components to see that unused formats has been deleted.
Important Note:
Since this script will modify each of the book components and will save them , it is advised to have a backup of your book in case you are using this script

Vikash Kumar
FrameMaker Engineering Team


  • Categories

  • Archives

  • Authors

  • Useful Links

  • Recent Comments

    • 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...
    • Bjørn Smalbro: Hi Welcome aboard to the new folks! I do have a couple of questions; 1: I have every sent in my...
    • Dieter Gust: Kapil How can I check the DITA-OT version which is installed with FrameMaker?