Structure Snippets can be automated through FDK clients, FrameScript or ExtendScript.
There are two API client calls available for use from other FDK plugins, FrameScript, or ExtendScript. These client calls are made from an FDK client using the F_ApiCallClient() function. A similar call can be made from ExtendScript or FrameScript using the CallClient() function. In all cases the first parameter is the StructureSnippets client name, which is “Pubs-Tools:StructureSnippets” (case sensitive). This must exactly match the spelling and casing of the entry in the maker.ini APIClients section. For example, to use the INSERTSNIPPET call, the following code could be used:
F_ApiCallClient("Pubs-Tools:StructureSnippets", "INSERTSNIPPET simpletable notetable 1");
Inserts a previously defined “snippet” at the current insertion point (or selection). The syntax is a space-delimited string as follows:
INSERTSNIPPET <elemname> <snipname> <sniptype>
Where:
These values correspond directly to the values used to create the snippet.
Runs a snippet script on the current document or book. The snippet script (snippetscript.ini) must exist in the folder that contains the file being processed. Use the following syntax:
RUNSNIPPETSCRIPT [<docOrBookId>]
Where: