Write your own FrameMaker ExtendScript, Part 1
This session (Part 1) goes through the process of creating a broadly useful ExtendScript for automating common tasks in FrameMaker, step-by-step. You can get a recording of the session here.
[Update]: Please also see our blog post for Part 2 of the session here.
Principles and Objectives for creating an Extend Script
Early on in the presentation, Rick shares key principles and objects, partially revealed in the screen capture below:
Minute Markers for key highlights in the webinar recording “FrameMaker: How to write your own ExtendScript, Part 1”
Rick Quatro IntroMajor goals of scripting:- state your major objective - divide your objective into tasks - work on each task
Working with an actual requirement of needing to add a modification date into a particular page of a documentAdd a temporary frame on page to enter a variable for MODIFICATION DATE LONG …grab content, copy to clipboard …create a custom marker
TYPE = MetaModDate (new marker type) …manually copy the modification date from variable into new MARKER …
Will use MIF2GO to pick up the content of these special markers. Rick demonstrated the process by hand so we know how to automate it through ExtendScript.
Run the sample script that automates the steps listed above. Rick’s client preferred this method, because they needed modification date in custom formats, which are easily managed through FrameMaker variables.
Start script with
"#target framemaker" to specify the application.Set some script variables.
Using Object Model Viewer in ExtendScript Toolkit CC to see Classes, Types as well as Properties and Methods.
Creating Desired marker type in the script: Entering
"GetNamedMarkerType" will provide pop-up with types to choose from …
Working with the script after the correct MARKER TYPE is added to the document. Some moments of typical “trouble shooting” of code … an example of this iterative process to complete a working function within the script.
Changing the order of functions in the script … create the marker type first …
Example of using
"/*" to comment out portion of script we wish to disable during testing
Creating a generic function that can be used over and over again …How to designate custom marker names to be added …
Saving a short script to be combined with other scripts later (recommended to create your script in pieces)
The necessity of 2 or 3 equal signs
"===" for certain lines of code in the script
Discussion of various ways to make COMMENT indicators …How to make a “block comment” to comment out several lines of script (useful for chunks of code you wish to temporarily comment out) …
Wiew of online PDF guide for nowHow to make a “block comment” to comment out several lines of script (useful for chunks of code you wish to temporarily comment out) …
Get the full recordings here: