Saturday, November 5, 2011

A very important FDK include file

I have found that using the Scripting Guide, it is sometimes not easy (or maybe even possible) to map constant names to their numeric values.

You can easily find such information if you have a copy of the FDK include file fapidefs.h. To get it you need to download the FDK but I think you will find it is worth the trouble to do so.

NOTE: Go to http://www.adobe.com/devnet/framemaker.html for the download. Look in the FDK10/include directory for the file.

Here you will find such things as the values for error codes, hex values for Frame flags (FF_*), scripting values (FS_*), initializations (FA_Init*,) notificaitons (FA_Note*) and more. These will help you decipher values you see in the ExtendScript data browser. As the file is easy to scan, it may also give you a sense of what is possible in certain situations. Just be aware that the file may contain unsupported features. In addition, I have not verified that the FrameScript wrappers for the FDK support everything.

fapidefs.h is a code file intended to be viewed in Microsoft Visual C++ but, as it is a text file, you can view it in any editor that can read plain text including, of course, FrameMaker.


I include some snippets from this file below just to show you its format.
...
/*Settings for FA_errno */
#define FE_Success            0   /* All's well */
#define FE_Transport          -1  /* Communications is falling apart */
#define FE_BadDocId           -2   /* Illegal Document or Book */
#define FE_BadObjId           -3   /* Illegal Object */
...
/* Initializations */
#define FA_Init_First             1  
#define FA_Init_Subsequent        2
#define FA_Init_TakeControl       3  
#define FA_Init_DocReport         4  

/* Notifications */
#define FA_Note_PreOpenDoc        1  
#define FA_Note_PostOpenDoc       2  
#define FA_Note_PreOpenMIF        3  
#define FA_Note_PostOpenMIF       4  
#define FA_Note_PreSaveDoc        5  
#define FA_Note_PostSaveDoc       6  
#define FA_Note_PreSaveMIF        7   
...

No comments:

Post a Comment