Extendscript of the Week: Create a upgraded copy of Book

Wednesday, October 12 2011 @ 7:09 AM, By anarora

 

As part of the series ‘Extendscript of the week’, we are providing an extendscript to Create a upgraded copy of Book that upgrades a legacy book and its components to latest FrameMaker version. This will show how to use FrameMaker ESTK to traverse a hierarchical book and perform operations on the components.

Download the zip file from BookUpgrade and unzip the content to local disk.

About the Script

  • It contains 3 scripts, BookUpgrade.jsx which is the caller function to handle the workflow, BookIterator.jsx which is used to iterate over the book components and BookUpgradeUtils.jsx that has utility functions (Open and Save) used in the automation
  • The script works on FM/MIF, nested books and its components as well as on the hierarchical components (Folders templates)
  • Any XML file, dita or map which is a part of the book is left untouched
  • The script traverses through the book, opens the book component file silently, saves it and then closes it. A backup of all the files will be created at the same location as the book files

Steps to use the Script?

  • Launch FrameMaker
  • Open any legacy book (or use the file Sample.book from the samples provided here: BookUpgradeSampleFiles)
  • With focus on book, run the script BookUpgrade.jsx
  • An alert will come, asking for your confirmation. If you click Cancel, the operation will be aborted
  • If you wish to continue by pressing OK, the script will run and convert all the chapters, including the Book itself, to FM10 version

Hope this simple automation will help to reduce your manual efforts and provide further insights into Extendscript usage.

Regards,
Anchal Arora

FrameMaker Engineering Team

(Resources: BookUpgradeScript , BookUpgradeSampleFiles)

COMMENTS

  • By Bjørn Smalbro - 10:23 AM on December 8, 2011  

    I am looking for someone to help me do some further developments on this script. I’d like to be able to point it at a folder containing multiple fm files – both book files and single fm files – and run the conversion. It will take too much time running each book file and I am not sure whether all single fm files are used in book files. Can you point me to some developer ?

  • Categories

  • Archives

  • Authors

  • Useful Links

  • Recent Comments

    • Joel: Thanks for fixing the links guys!
    • Maxwell Hoffmann: Ted, one aspect of the blog that may have escaped your notice; you can launch the HTML5 version in...
    • Maxwell Hoffmann: Joel, per comments made above, I discovered that the original URLs were incorrect with pointers to...
    • Maxwell Hoffmann: Paul, as I indicated in the comments below, the original blog had links that pointed to a...
    • Maxwell Hoffmann: I apologize to all concerned regarding my suggestion to “clear the cache” … it...