Modifying Markers in FrameMaker at Book level through ExtendScript
Hello Framers,
In this blog post, we will talk about an ExtendScript, which updates marker text of a particular type by iterating over all the components of a book. This example script again reinforces the notion of ExtendScript being very handy for doing repetitive tasks in FrameMaker or doing some little enhancements over the existing features.
Description:
The script takes three parameters from the user. First it prompts the user for the marker type which needs to be updated. Then it prompts the user for the marker text which needs to be replaced. It can be a substring of the original marker string of the complete marker string itself. Lastly, it asks for the updated marker text with which the original marker text needs to be replaced. After this, it opens the components of the book one by one, updates the marker string of that particular type and then closes the document after saving. At last, it gives an alert to the user stating the numbers of markers which have been updated.
Usage:
Download the attached script and the sample files from here and unzip the package. Open the sample book and make sure that the book is in focus while running the script. Give the marker type for example as “Index”, text to be replaced as “gyan” and the new text as “new gyan”. At last, it will give an alert stating the number of markers which have been updated.
Feel free to modify this script according to your own requirements.
Happy Scripting!!