FrameMaker Super Find Change

FrameMaker Super Find / Change Reloaded

Did you ever wanted to replace the format of all cross-references with another cross-reference format? Or one variable format with another? Or one condition tag with another one? Or change the table style for all tables with another table style? Or change the formatting of all paragraphs tagged with this wired “03_a_bd-ind-l1_2006_v3” paragraph styles with a simple “Body” style? Or reformat all those words tagged with the character style “bold” with the character style “strong”?

A couple of years back, we published the free ExtendScript “Change Formats”. The script made it possible find and change Variables, Cross-Reference Formats and Conditional Tags. We got so much feedback over the years and still today the script gets a lot of downloads. So we decided to make this script even more powerful and update it to FrameMaker (2015 release).

Introducing “FrameMaker Super Find Change”

FrameMaker Super Find Change is an ExtendScript to find and replace Paragraph Styles, Character Styles, Table Styles, Variables, Cross-Reference Formats and Conditional Tags in a single FrameMaker file or in a complete Book.

Our new ExtendScript “Super Find Change” for FrameMaker (2015 release) extends the possibilities of the first script. It makes it easy to find and change styles / formats in a single-file or on book level:

  • Paragraph Styles

  • Character Styles

  • Table Styles

  • Variables (system and user variables!)

  • Cross-Reference Formats

  • Conditional Tags

This script also demonstrates the strength and flexibility of FrameMaker in combination with ExtendScript. ExtendScript makes it easy to add new functionalities on top of FrameMaker and automating manual steps.

Steps to Install

Note: If you have the old script installed, make sure to delete it first.

  1. Download the zip file FrameMaker Super Find Change.

  2. Unzip the files and copy the SuperFindChange.jsx and the two subfolders ChangeFormat and ChangeStyle in FrameMaker’s startup folder located at:
    C:\Program Files (x86)\Adobe\AdobeFrameMaker2015\startup\

How to use the Script

Important: There is no “Undo”! Make sure to save your work before executing the script and backup your files first.

  1. Launch FrameMaker.

  2. Open a Book file or FrameMaker or MIF file.

  3. Run Super Find Change from “File > Utilities > Change Formats …”

  4. The Super Find Change dialog opens.

  5. Click on the radio button to choose the object you want to change.

  6. Choose the value to be changed in the “Find” dropdown.

  7. Choose the value to be applied in the “Change” dropdown.

  8. Click on Change button.

Information about the Scripts

  • The zip contains various ExtendScripts:

    • SuperFindChange.jsx loads the menu and calls the function to execute the workflow.

    • ChangeConditionalFormat.jsx is used to change the conditional tag.

    • ChangeVariable.jsx is used to change the variable.

    • ChangeXrefFormat.jsx is used to change the format of the cross reference.

    • ChangeStyleCharTags.jsx is used to change the character styles.

    • ChangeStyleParaTags.jsx is used to change the paragraph styles.

    • ChangeStyleTableTags.jsx is used to change the format of the tables.

    • ChangeFormatUtils.jsx contains various utility functions.

    • ChangeFormatUI.jsx prepares the UI to be launched in FM.

    • BookIterator.jsx is used to iterate over the book.

  • 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.

  • Important: There is no “Undo”! Make sure to save your work before executing the script and backup your files first.

  • The script will pick up the format/variable/tag/para tag/char tag/table tag from the document or the first non-generated component of book.

  • If run on a book, all unopened components will be opened silently and will be modified, saved and closed without asking. All opened components will be modified and left visible.

  • You can include System Variables. By default System Variables are excluded as it makes the list quite long.

  • You can also delete the cross-reference, conditional tag / user variable format which was replaced after the changes have been made.

  • At the end, you will be notified about the number of changes made in the document.

Here you can download the script: FrameMaker Super Find Change.

The script is for demonstrating the possibilities of ExtendScript and for learning purposes. It is provided without any warranty and any use is on your own risk.

We hope this will prove useful to many folks, and you can add extra functionality as per your requirements to these scripts to make it even more powerful. Let us know what you think in the comments below.

Bharat Prakash

Bharat Prakash

Bharat Prakash is the Product Solution Consultant for the Technical Communication unit at Adobe and has more than a decade’s experience in software development, testing and consulting. He has extensive experience in end-to-end deployment of features from conception to delivery with wide exposure to different SDLC models. Bharat is an expert in Structured Authoring and various industry standards like DITA and MathML.

14 thoughts to “FrameMaker Super Find / Change Reloaded”

  1. Hi

    We are having issue with script not returning any results, had the same issue before but cannot remember the fix (Frame 12).

    Thanks

  2. Hi Stefan,

    Thank for your response!

    All my book files have the same set of variables and conditions. So, the scenario you mentioned may suit your personal setup.

    I realize that the script is provided as is but on the other hand, the script is intended for general audience and not just for Extendscript experts.

  3. The updated script is still buggy.
    Let’s say I’d like to replace variable A with variable B and delete variable A afterwards. Instead of doing that, the script just deletes variable A. It’s definitely a well-tested script…

    1. Hi RB,

      nice catch. I analyzed this and could reproduce it. It’s like this: The script pulls the variable definitions from the first book component and offers them in the drop downs. When you want to replace a variable on book level, you need to make sure, that the variable you select in the “Replace with:” drop-down is also available in the other book components before you execute the script. The script does not create missing variables in book components and therefore replacing an existing variable with a variable that is not existent in the document actually deletes the variable.
      Solution: make sure that all variables are available in all documents before you run the script. You can do this by opening the “variable source document” that contains all variables you want to operate on, opening the book file, select all book components and use File > Import … > Formats… and import the variables from the open “variable source document”.

      Please note, that the script is for demonstrating the possibilities of ExtendScript and for learning purposes. It does not catch all possible scenarios that one might think of and the focus is not on error handling.
      The code is provided open and intended to provide a starting point for people who want to write their own ExtendSripts. So, please feel invited to play with it, modify the code or even add new functionalities. And please feel invited to share it, so that other peers can use it as well. The more people contribute, the better it will get.

      That said, thanks again for catching this 🙂

      Cheers,
      *Stefan.

  4. I just ran into this while doing a search. I haven’t had an opportunity to play with it yet (management is clearing the red tape before Frame 2015 installation). I’m curious whether it can simply REMOVE a character tag rather than just change it. For example, if our client says “please remove all bolded body text,” can I use this tool to remove the Bold tag from all text without replacing it with some other tag?

  5. Hello, I have a question.
    How can I find and replace a loop? The fact is that when I try to change all NULL DATA LINK I can not do it at one time, have to be repeated over and over again

  6. I installed this tool and the “U” key was disabled on my keyboard – yes I swapped out keyboards and rebooted several times.

    Got rid of the Super Find files, rebooted and my keyboard returned to normal.

  7. Thank you Bharat for a great set of find/change utilities!

    One suggestion to expand on the versatility: add the ability to find/change Object Styles and graphic attributes (line styles, weights, fills, outlines, etc.)

Leave a Reply to Nelson Abbey Cancel reply

Your email address will not be published. Required fields are marked *