ExtendScript of the Week: Generate List of Referenced Graphics and Update Their New Paths


As part of the series ‘ExtendScript of the week’, we are providing an ExtendScript to generate a list of referenced graphics in a FrameMaker book. The list will also show the status that whether the referred graphic is resolved or not. After the list has been generated, you can modify the paths of the referenced graphics in the table and the table can be imported back to the book.This will help fixing any unresolved referenced graphic at the book level.

Download the zip file from ImportExport.

About the Script

  • It contains 3 scripts, menu.jsx which loads the menu items and calls functions to handle the workflow, importExport.jsx which is used to import/export list of referenced graphics and utils.jsx that has several utility functions. It also contains a template document, BookReportTemplate, which is used for dumping report of referenced graphics.
  • The script works on FM/MIF, nested books and its components as well as on the hierarchical components.
  • Any XML file, dita or map which is a part of the book is left untouched.
  • The import functionality traverses through the book, opens the book component file silently and extracts the referenced graphics information. File is then closed silently without saving. A book report (table) containing a list of all referenced graphics in the book is generated.
  • The export functionality traverses the report document to locate a table and name of the source book. The information of each referenced graphic is extracted from the table and the information is updated in the document (in source book) if required. Any document not found in the scope of the source book is left as is. Also, the modified documents in this process will not be closed/saved but will be left open visibly in FrameMaker and user can have a look at the console window for the list of changes made.

Steps to use the Script

  • Unzip the contents of the attached .zip file to the FrameMaker startup folder
    “C:\Program Files\Adobe\AdobeFrameMaker11\startup”
  • Launch FrameMaker
  • For export functionality, open any book for which you want to generate list of referenced graphics report
  • With focus on book, go to “File > Utilities > Export Referenced Graphics List”
  • A FrameMaker document report containing the list of referenced will be generated
  • For import functionality, modify the report generated from the export functionality to update any graphic paths
  • With focus on the report document, go to “File > Utilities > Import Referenced Graphics List”
  • 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 update the documents (if required)

NOTE: Once you have downloaded and “installed” the script, open the file “BookReportTemplate” in FrameMaker and save it. You can also change the design of the template as you like (e.g. from portrait to landscape, default font, colors etc.) to get reports that fit to your needs.

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

Saurabh Agrawal

FrameMaker Engineering Team

(Resources: ImportExportScript)

ExtendScript, FrameMaker, Products

Posted on 10-27-2011


  • By Carla Martinek - 4:29 PM on June 29, 2016   Reply

    Will this script allow me to REPLACE .eps named graphics by pointing at the new .ai graphic in a new location?

  • By Webber - 8:16 AM on January 10, 2014   Reply

    Thank you for this great script!

  • By disqus_roRiiJexI1 - 9:37 PM on October 15, 2013   Reply

    Why do I keep getting an alert saying “Could not open template report document”?

    • By Milo Grika - 6:28 PM on February 4, 2014   Reply

      I got the same error. I had to open BookReportTemplate in FrameMaker and save it, then it worked fine.

  • By radub22 - 8:53 AM on September 6, 2013   Reply

    For FM 9 exist this script?

  • By Andrea Notroff - 5:25 PM on December 9, 2011   Reply

    I’ve got a question: In the script, you use this method:

    updateInsetFile(currDoc, objId, filePath);

    Since you don’t define the method yourself, it seems to be part of the object model of ExtendScript. But I can’t find it in the ExtendScript documentation (object model viewer, framemaker_10_scripting.pdf). Can you point me to any source of information about the method and its parameters?

    I’m looking for any methods that might help with importing graphics or modifying the pathname and the DPI of a graphics object (inset).

    Thank you very much

    • By Saurabh Agrawal - 5:24 AM on December 12, 2011   Reply

      Hi Andrea,

      This function is defined in the other file named “utils.jsx” at the bottom. You may use this function as a prototype to update the properties of a graphic object.


  • […] (Dies ist eine gekürzte Fassung des Adobe-Beitrags »Generate List of Referenced Graphics and Update Their New Paths«) […]

  • By Saurabh Agrawal - 5:55 AM on October 28, 2011   Reply

    Hi Michael,

    Thanks for pointing that out. Keeping these scripts in the user’s profile area will work in exactly the same manner.


  • By Michael Müller-Hillebrand - 2:03 PM on October 27, 2011   Reply

    Question: Is there a certain reason you recommend installation in the program files startup folder? There is a startup folder in the user’s profile area (%appdata%\Adobe\FrameMaker\10\startup) which is accessible to a standard user without requiring administrative.

Reply to disqus_roRiiJexI1