RE: Subject: Frame and macros

Subject: RE: Subject: Frame and macros
From: "Smith, Martin" <martin -dot- smith -at- encorp -dot- com>
To: TECHWR-L <techwr-l -at- lists -dot- raycomm -dot- com>
Date: Wed, 28 Jun 2000 10:29:41 -0600

Kandis Weiner wrote "It is my understanding that FrameMaker does support
scripting, through a
third-party software" (called FrameScript: http://www.fml.com/) "Martin
Smith posted an email a couple of weeks ago about using this scripting
program to create context-sensitive help from frame files. Seems to point to
its utility."

Yes, and what a useful program it is. I have indeed written scripts to
create HTML Help and Dynamic HTML web pages from FrameMaker books. I have
also written scripts to extract the comments from our source code and create
alphabetized, completely formatted reference manuals. I use the result of
this script as a starting point when writing documentation. I also use this
script to keep track of the engineers changes to the code.

FrameScript is a simple, text-based, object-oriented language. You can write
scripts with a simple text editor like notepad. FrameScript exposes Frame's
complete C language API, allowing you to write scripts that interact with
your FrameMaker documents and books.

I've included a simple script below. This script creates a new FrameMaker
document using the formats contained in the document named "My_Template.fm"

New Document Template('C:\My_Template.fm') NewVar(My_Doc);

Set MainFlow_OBJ = My_Doc.MainFlowInDoc;
Get Object Name('Heading1') Type (PgfFmt) NewVar(Heading_1_Fmt);
New Paragraph PrevObject(MainFlow_OBJ) NewVar(Pgf_OBJ);
New Text Object(Pgf_OBJ) 'This is a heading';
Set Pgf_OBJ.properties = Heading_1_Fmt.properties;

Line 1: Creates a new document using the formats from "My_Template.fm"
Line 2: Initializes the variable "MainFlow_OBJ" which points to the main
text flow in the document.
Line 3: Obtains the paragraph format named "Heading1" and stores its
properties in "Heading_1_Fmt"
Line 4: Creates a new paragraph in the main flow of the document.
Line 5: Types text in the paragraph: "This is a heading"
Line 6: Applies the paragraph format "Heading1" to the newly created
paragraph.

As you can see, this is a very easy language to use and the documentation is
excellent. I have no affiliation with Finite Matters Ltd. but have really
enjoyed working with this program. I am constantly finding new ways to
automate repetitive tasks.

Enjoy,

Martin R. Smith
Technical Writer/Audiophile
ENCORP: The Energy Automation Company




Previous by Author: RE: being too picky? (long)
Next by Author: Books on managing documentation projects
Previous by Thread: RE: Subject: Frame and macros
Next by Thread: Re: Subject: Frame and macros


What this post helpful? Share it with friends and colleagues:


Sponsored Ads