Adobe 65030365 - FrameMaker - PC Manual page 17

Scripting guide
Hide thumbs Also See for 65030365 - FrameMaker - PC:
Table of Contents

Advertisement

ADOBE FRAMEMAKER SCRIPTING GUIDE
Differences between scripts and FDK
The
property is readily available to all FrameMaker scripts and maps to the
app
In this example, you query the
FrameMaker Session. The reference to this object is stored in the variable
doc = app.ActiveDoc;
flow = doc.MainFlowInDoc;
sync = flow.FlowIsSynchronized;
Explanation:
• Line 1 stores the reference to the Active Document Object.
• Line 2 creates an object called flow by querying a property of the doc object.
• Line 3 queries a property of the newly created flow object (created in line 2).
You can query each of the object references as a new object recursively, until you reach the desired object property:
sync = app.ActiveDoc.MainFlowInDoc.FlowIsSynchronized;
The same example in FDK is as follows:
F_ObjHandleT docId, flowId;
IntT sync;
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
flowId = F_ApiGetId(FV_SessionId, docId, FP_MainFlowInDoc);
sync = F_ApiGetInt(docId, flowId, FP_ FlowIsSynchronized);
As discussed in the table above, Example 1 demonstrates how FDK properties [
and
FP_FlowIsSynchronized
].
FlowIsSynchronized
Example 2:
Example 2 builds on Example 1 and shows how methods are called in scripts.
Every object has some methods of its own. These methods can be invoked in the same way as properties are invoked.
In Example 1, you created the
doc.UpdateVariables();
This code calls the
UpdateVariables
FDK users can relate these methods to FDK APIs. The same code in FDK becomes:
F_ApiUpdateVariables(FV_SessionId, docId);
Notice how the FDK API
F_ApiUpdateVariables
mentioned in the table above.
Global Methods:
Not every method is accessible through a specific object. There are some methods that are not called through any
objects but are called directly. These methods are called Global Methods. Examples of Global Methods include
,
ChooseFile()
CallClent()
In addition to these methods, all FDK Variables and Macros are available as Global Methods. These Variables usually
start with
in FDK.
FV_
Consider the following line of code for FDK:
F_ApiSetInt(FV_SessionId, docId, FP_Capitalization, FV_CAPITAL_CASE_SMALL);
property that returns the
ActiveDoc
] are mapped to script properties [
object. To invoke a method, use
doc
method of the
object.
doc
becomes the method name
and
.
Sleep()
Last updated 9/26/2011
FO_Session
Active Document Object(Doc)
.
doc
FP_ActiveDoc
,
ActiveDoc
MainFlowInDoc
. For example,
doc.methodname()
UpdateVariables
9
object in FDK.
in the current
,
FP_MainFlowInDoc
and
in scripts, as

Advertisement

Table of Contents
loading

This manual is also suitable for:

Framemaker 10

Table of Contents