Script programming

The WinWrap Basic Script Editor is an interactive design environment for developing, testing, and executing WinWrap Basic scripts. Events are fired that can be used to individually program new formatting, extraction, and validation procedures. The WinWrap Basic Script Editor is accessible via the Script Code window.

Field formatting procedures are defined at the project level. The general extraction script is used to implement the Script Locator, field extraction, and field validation methods. Apart from the general field extraction script, each class has its own field extraction script to provide class-specific processing. When folders are enabled, scripting for the batch can be defined on the project folder level; on folder level, scripting related to the extraction, validation, and verification process can be defined for the folder and its fields.

Note For each class, or folder, a separate extraction sheet is added to the Script Code Editor to support level-specific extraction and validation procedures. The caption of the Script Code window helps you to know whether you have selected the correct sheet tab.

You can add scripts to the following levels:

Important There might be use cases where you need to bring up the hidden Script Code window to be able to stop the script execution. This may occur when you are processing documents and the script is malfunctioning, or has a lengthy operation. To be able to bring up the hidden Script Code window, you can use one of the following shortcut keys:
  • Press Pause to display the Script Code window.
  • Press Ctrl + BREAK to display the Script Code window and break the script.

For more information about the WinWrap Basic Script Editor and script programming, you can select the following Help topics from the Help submenu of the WinWrap Basic Script Editor, or press the according shortcut keys:

  • Editor Help - contains the documentation of the WinWrap Basic Editor.

  • Language Help (Shift + F1) - provides information about the WinWrap Basic Language.

  • Scripting Help - provides an overview of the available events, small code samples to show their usage, and figures to illustrate the event sequence during the document recognition process.

  • Scripting Object References - contains the API documentation and object models for the relevant object libraries to improve the usability of the COM components.

  • Topic Search (F1) - provides the topic search function of the WinWrap Basic Editor Help whenever you select a keyword.

Note When loading a project created with an earlier version of Kofax Transformation Modules, any scripts are automatically updated if the variable name of any field, formatter or validation method has changed due to the new script name mapping. A project upgrade warning is displayed in Project Builder when the project is first opened to notify you that the script was modified.