Create results for a simple field Script Locator

You can write a script routine to perform any operation within the limitations of the Kofax Transformation Modules object structure. For full documentation about scripting, see the Scripting Help.

Typically, the script routine is written to produce the results of the Script Locator, usually by retrieving and modifying the data from other locators. These results can then be associated with extraction fields.

You can create results for a simple field script locatorby following these steps:

  1. Create one or more alternatives as follows:
    pLocator.Alternatives.Create
  2. In combination with additional logic, use the results from other locators to create the required values within the Script Locator. Retrieve results from other locators as follows:
    pXDoc.Locators.ItemByName(<Locator Name>).Alternatives(<N>).Text

    This example retrieves the alternative with index N from a locator producing multiple single-result alternatives, such as a Format Locator.

    pXDoc.Locators.ItemByName(<Locator Name>).Alternatives(<N>).Subfields.ItemByName(<Subfield Name>).Text

    This example retrieves a subfield result from a locator producing multiple subfields per alternative, such as an Advanced Zone Locator.

  3. Assign text values to the alternatives in the Script Locator alternatives collection.
    pLocator.Alternatives(<N>).Text = <Text Value>
  4. Assign a confidence value (between 0 and 1) to the alternatives in the Script Locator alternatives collection.
    pLocator.Alternatives(<N>).Confidence = <Confidence Value>
  5. If required, assign coordinate values (in pixels) to the alternatives in the Script Locator alternatives collection.
    pLocator.Alternatives(<N>).Top = <Top Coordinate>
    pLocator.Alternatives(<N>).Left = <Left Coordinate>
    pLocator.Alternatives(<N>).Height = <Height>
    pLocator.Alternatives(<N>).Width = <Width>