Update and Add Paragraph Formats with Template Tools

TemplateTools is a powerful script that allows you to quickly format and update Paragraph Formats using FrameMaker’s formatting toolbars. Easily add new Paragraph Formats and format them “by example” in the document. Quickly remove Paragraph Format overrides and unused Paragraph Formats. Click here to see the documentation. The 7 minute video below will show you how it works. TemplateTools makes working with Paragraph Formats fun and easy!

To purchase TemplateTools for a low, introductory price, please visit our solutions store.

Here is a video of the full webinar demonstrating TemplateTools.

Adobe Webinar: FrameMaker ExtendScript Examples

Update

Thanks to the generosity of many, Jason and I have reached our fundraising goals for the Ride! As a result, I am withdrawing the offer for the scripts. Thank you for your help!

If you attended the webinar on April 29, 2015, you saw some realistic examples of using ExtendScript to automate FrameMaker. The scripts are well-commented and ready for production work. If you are learning ExtendScript, you can use many of the functions and techniques in your own scripts.

Here is a PDF that describes each script.

Thank you for your generous support of a great cause!

Update

For those that received the scripts by donating, or saw them during the webinar, I am interested in your questions and feedback. Please add a comment to this post, and I will start a new post to discuss your questions and comments.

Running a FrameScript Script from DITA-FMx

DITA-FMx is a great plugin for working with DITA in FrameMaker. One of its best features is the ability to create a complete FrameMaker book from a ditamap. In some situations you may want to run a script on the book before creating the PDF. Scott Prentice, the developer of DITA-FMx, has a blog post explaining how you can call an ExtendScript script from DITA-FMx. This article will show you how to call a FrameScript script from DITA-FMx.

To set this up in DITA-FMx, you will need to edit the BookBuildOverrides section of the book-build INI file that you are using with DITA-FMx. Here are the three keys that need to be edited:

[BookBuildOverrides]
...
RunScript=1
ScriptName=fsl
ScriptArgs=myEventScript

RunScript is a 0 or 1 value. Setting it to a 1 tells DITA-FMx that you want run one or more scripts or FDK clients. ScriptName for FrameScript is fsl. The ScriptArgs value is the name of the installed FrameScript “event script” that you want to run.

Before we go further, let me give a little background on FrameScript scripts. FrameScript has two kinds of scripts: Standard scripts and Event scripts. A standard script can consist of functions, subroutines, and events, but it always has an entry point that is not inside of a function, subroutine, etc. Typically, you “run” a Standard script, it loads into memory, runs to completion, then is flushed from memory.

Event scripts are not run directly; they are “installed” first and then “wait” for some kind of event to happen; for example, a menu command, a FrameMaker event, an outside call, etc. All of the code in an event script must be inside of a function, subroutine, or event. The entry point for an event script is some kind of an event inside of the script. One point that is pertinent to this post is that an installed Event script has a name, and this name is the value you use for the ScriptArgs key.

Instead of installing your event script manually, it is best to install it automatically with an “Initial Script”, which runs automatically whenever you start FrameMaker. That way, your event script will installed automatically when you start FrameMaker. Here is an example Initial Script:

// InitialScript.fsl Version 0.1b August 26, 2013

Local sPath('');

// Get the path to this script.
Set sPath = eSys.ExtractPathName{ThisScript};

// Install the event script that will receive the DITA-FMx call.
Install Script File(sPath+'Script1.fsl') Name('myEventScript');

This command will install the script “Script1.fsl” that is in the same folder as the Initial Script (InitialScript.fsl). The important parameter on the Install Script command is Name; the name supplied must match the name you give to the ScriptArgs key in DITA-FMx’s book-build INI file. Here we are using “myEventScript”.

To run this script automatically whenever FrameMaker starts, choose FrameScript > Options and click the Browse button next to the Initial Script Name field. Navigate to the InitialScript.fsl file and select it, and then click Save to close the Options dialog box.

FrameScript Options dialog box

Before you quit and restart FrameMaker, you will need to have Script1.fsl in the same folder as the InitialScript.fsl file. Here is a shell you can use for this script:

// Script1.fsl Version 0.1b August 26, 2013

Event NoteClientCall
//	
If ActiveBook
  Set iResult = ProcessBook{ActiveBook};
EndIf
//
EndEvent

Function ProcessBook oBook
//
//... Do something with the book here ...
//
EndFunc

The NoteClientCall event is a built-in event that “waits” for the outside call; in this case, from DITA-FMx. We test to make sure that there is an active book, which should be the book that DITA-FMx just created from the ditamap. If there is an active book, we call the ProcessBook function, which is where we process our book with FrameScript code. We could have our book code right in the ProcessBook function, or we could use this function to call other scripts or functions.

Please let me know if you have any questions or comments about calling FrameScript scripts with DITA-FMx.

Riding in Memory of Bruce Foster

Bruce Foster, creator of many fine FrameMaker plugins, passed away suddenly on Saturday, June 11, 2011. Although Bruce had been diagnosed with multiple myeloma in September 2010, his death still came earlier than was expected. Bruce’s plugins for FrameMaker were BookInfo, ImpGraph, MifSave, MifToFM, RtfSave, and his most famous, Archive.

My son, Jason, and I will be riding the 2013 Ride for Roswell to benefit cancer research. This year we will ride the 104 mile route. I will be riding in memory of Bruce and Jason will be riding in memory of his grandfather, Dr. Richard J. Quatro. We would appreciate your sponsorship.

If you donate $40 or more to either of us, I will give you a copy of the ExtendScript version of PageLabeler or ImportFormatsSpecial. Both of these have been written in ExtendScript for use in FrameMaker 10 and higher. To see the documentation for these scripts, click the links above. For a $75 donation, you will receive both scripts, including the source code.

If you are using FrameMaker 9 or below, I will send you the plugin versions instead. Be sure to email me to tell me what you would like to receive after donating.

Rick has met his fundraising goal. Please click here to donate to Jason’s ride.

Thank you very much for your support!