ExtendScript of the Week: Close All Files in a Book without Saving

Wednesday, November 16 2011 @ 5:07 AM, By anarora

 

Continuing with the series ‘Extendscript of the week’, we are providing an extendscript to Close All Files in a Book without Saving. This will show how to use FrameMaker ESTK to traverse a hierarchical book and perform operations on its components.

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

About the Script

  • It contains 3 scripts, CloseAllFilesInBook.jsx which is the caller function to handle the complete workflow, BookIterator.jsx which is used to iterate over the book components and BookCloseAllUtils.jsx that has utility functions used in the automation
  • The script works on all file types (FM/MIF/XML/Ditamap), nested books and its components as well as on the hierarchical components (Folders templates). Parameters have been defined in the main function according to which the components types will be acted upon (to process or leave unprocessed) making it a configurable setting.
  • The script traverses through all the open files in the book and closes it without prompting the user for Save dialog.  By default no file is saved.

Steps to use the Script?

  • Launch FrameMaker
  • Open any book (or use the file Sample.book from the samples provided here: CloseAllFilesInBookSampleFiles)
  • With focus on book, run the script CloseAllFilesInBook.jsx. This will create a new menu item in Book Menu
  • Goto File->Utilities->Close All Files in Book Without Saving
  • All open book files will now be closed without any prompt

This script will help reduce the painful task on clicking on the dialog each time on closing multiple files. It can be easily modified to Save all the files by default.

 

Regards,
Anchal Arora

FrameMaker Engineering Team

(Resources: CloseAllFilesInBookScriptCloseAllFilesInBookSampleFiles)

  • Categories

  • Archives

  • Authors

  • Useful Links

  • Recent Comments

    • Dieter Gust: Very nice several goodies in addition to bugfixes!! I like that very much! Dieter
    • Don Bridges: I expect privacy concerns will tamper IoT for our homes and consumers, but for business it will usher a...
    • Lois Patterson: I’m always happy to see math support, although I’m not currently using FrameMaker. I have...
    • Olga: I know it’s a really old post but I was unable to find any information online. I need to number the...
    • click: yes. http://wwwimages.adobe.com/www .adobe.com/content/dam/Adobe/e n/volume-licensing/pdfs/avl...