Write your own FrameMaker ExtendScript, Part 1

In January, long-time FrameMaker maven, Rick Quatro of Carmen Publishing, did a guest appearance in the first of a 2-part series on FrameMaker ExtendScripts.

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:

00 SCRIPT OBJECTIVES

Minute Markers for key highlights in the webinar recording “FrameMaker: How to write your own ExtendScript, Part 1”

03:20

Rick Quatro IntroMajor goals of scripting:- state your major objective - divide your objective into tasks - work on each task

10:00

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 …

13:00

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.

18:00

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.

01 SCRIPT IN PROGRESS

19:00

Start script with "#target framemaker" to specify the application.Set some script variables.

22:00

Using Object Model Viewer in ExtendScript Toolkit CC to see Classes, Types as well as Properties and Methods.

28:00

Creating Desired marker type in the script: Entering "GetNamedMarkerType" will provide pop-up with types to choose from …

33:00

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.

35:00

Changing the order of functions in the script … create the marker type first …

36:00

Example of using "/*" to comment out portion of script we wish to disable during testing

40:00

Creating a generic function that can be used over and over again …How to designate custom marker names to be added …

42:00

Saving a short script to be combined with other scripts later (recommended to create your script in pieces)

50:00

The necessity of 2 or 3 equal signs "===" for certain lines of code in the script

52:00

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) …

53:00

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: