Extendscript of the Week: Create a upgraded copy of Book
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.
FrameMaker Engineering Team
(_Resources: _BookUpgradeScript , BookUpgradeSampleFiles)