
12
ADOBE FRAMEMAKER SCRIPTING GUIDE
Differences between scripts and FDK
Last updated 9/26/2011
desired even occurs.(Similar to F_ApiNotify())
Syntax for this callback function is:
@params
note: notification id to identify the event.
object: current document or book object which generated the event.
sparam: The string, if any, associated with the notification
(For example, if the notification is for an Open or Save operation, sparm specifies the
pathname of the affected file. If the notification is for text entry, sparm specifies the text the
user typed.)
iparam: The Integer, if any, associated with the notification. Probably the fcode or bit flags.
Notify(note, doc, sparam, iparam)
Note: for more details please see F_ApiNotify() in FDK reference guide.
*/
function Notify(note, object, sparam, iparam)
{
switch (note) {
case FA_Note_PostOpenDoc:
alert("Opened document " + sparam);
break;
}
The line of code:
Notification(FA_Note_PostOpenDoc,true);
registers this script for the
FA_Note_PostOpenDoc
notification. This notification is triggered
just after
any document
is opened in FrameMaker.
The lines of code:
function Notify(note, object, sparam, iparam)
{
switch (note) {
case FA_Note_PostOpenDoc:
alert("Opened document " + sparam);
break;
}
pops up an alert with the file name just after the file is opened.
Menus and Commands
Scripting allows you to add custom menus and associate commands with these menus. In addition, you can implement
your own handlers for commands in a similar way as the FDK.
The following script adds two menus and associated commands to the FrameMaker main menu.