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

    • Mark Carson: Whoops, I meant “on” it…
    • Mark Carson: Sure hope Praveen likes to work on a Mac and wishes FrameMaker was no it.
    • Dieter Gust: Congratulations for a great work done! We finally got several exciting new features. My favorites: 1.)...
    • Maxwell Hoffmann: Hello Paul; I just tried link to video with Chrome and it does work. Try this; clear cache in your...
    • Paul: I could not get this presentation to play. I tried it in both IE and Chrome. It would start to play and get...