Programmatic Control of FM2DITA

FM2DITA provides scripting and API access to many of the commands.

In order to facilitate custom automation of your conversion process, the FM2DITA commands intended for non-interactive operation can be used with the CallClient function. These commands are assigned a special “API code” that runs that command using the current default settings (as defined in the fm2dita.ini file). The CallClient function is available in the FrameMaker FDK “C” programming interface as well as FrameMaker ExtendScript (release 10 and later), and FML FrameScript.

All CallClient calls use the same arguments. First is the client name, typically “Pubs-Tools:FM2DITA”, but it may be something else if you have modified the entry in the APIClients section of the maker.ini file. The client name argument must match the associated parameter name in the maker.ini file. The second argument is the API code for the command. At this time you cannot pass any other arguments to the commands.

When calling an API code, the operation will be applied to the document or book that currently has the focus. Any errors or information will be written to the FrameMaker console.

The following example is the FDK code to call the Show All Conditions command:

F_ApiCallClient("Pubs-Tools:FM2DITA", "SHOWALL-CONDS")

The following example is the same call using ExtendScript:

CallClient("Pubs-Tools:FM2DITA", "SHOWALL-CONDS");

The following list maps the API codes to the associated commands: