Utility to Highlight All Occurrences of a Word in a FrameMaker Document

Thursday, October 25 2012 @ 5:23 AM, By anarora

Hello Framers,

In this blog post, I am going to describe “Highlight all occurrences of a word” – a very commonly used text-editing feature, internally developed using FDK ( Frame Development Kit) and FrameMaker’s conditional text feature.
This will help for fast visualization of a specific word used throughout the document. Sometimes using FrameMaker’s native Find & Replace utility doesn’t help as one has to do multiple clicks. This can save you the trouble of manually cycling through the document.

 

Description: Once the client is registered in FrameMaker, it will be available in all documents. Whenever you select any word, all occurrences of that word are highlighted in the document in green.

  • It works on FM documents, mif and xml files
  • It works only on single words, with no whitespaces in between.

 

Usage

  • Add the following entry (all in one line) to the [APIClients] section of your  maker.ini  file:
    HighlightAll=Standard, Select all occurrences of selected word, <path of downloaded dll>\Highlight.dll, all
  • Open any document and select a word – you will see all its occurrences highlighted

 

Technical Details:

Here is a small gist of the way the client works: (attached here):

  • When any word is selected, a new temporary conditional tag is created with background color property set to Green.
  • F_ApiFind is used to find the word
  • The tag is applied to each occurrence found
  • Whenever text selection is changed (through single click or selecting another word) the temporary tag is deleted and hence the word is un-highlighted.
  • Before saving the doc too, the tag is deleted so that no changes are saved in the document.
  • Getting changes in text selection is done through the use of FA_Note_PostMouseCommand notifications

I have attached the source code for further details.

NOTE: This utility will work only in FrameMaker 11 because some enhancements made in conditional text feature have  been used.

Do try the utility and let us know your valuable feedback!

 

With best regards,
Anchal Arora

Sr Software Engineer,
Adobe FrameMaker Engineering Team

COMMENTS

  • By Arnis Gubins - 4:56 PM on October 25, 2012  

    It would be quite beneficial (education wise) if you could provide an Extendscript version of this utility. Users could then more easily adapt this example to change the colors and play with the search strings.

  • Categories

  • Archives

  • Authors

  • Useful Links

  • Recent Comments

    • 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...
    • tiggyboo: I know the specs say IE 9 or greater is required – but was Server 12 developed specifically for IE or...