Skip to main content
The following considerations apply to scripts written in .NET languages (C#.NET, JScript.NET, and VisualBasic.NET).

Assemblies and namespaces

  • Compile .NET assemblies with Microsoft .NET Framework 4.0 or later. Specify the .NET Framework version in your Visual Studio project properties. Note. For details on using libraries created in .NET Framework 2.0, 3.0, and 3.5, see ABBYY FlexiCapture compatibility with different versions of the .NET Framework.
  • Add external assemblies for use in scripts and global modules. Both standard and compiled user assemblies work, and all their classes are available in scripts and global modules. For more information, see External assemblies.
  • Scanning Station script objects reside in the ScanStationInterop.dll assembly and belong to the ABBYY.ScanStation namespace. This assembly is in the root folder of the Scanning Station.
All ABBYY Scanning Station script objects are accessible by their own names from the ABBYY.ScanStation namespace. For example:

Syntax

Access object elements with the Workspace and ExportBatch keywords. Write using directives at the beginning of the script body, together with comments and empty lines. Use the same syntax as in the programming language (using for C#.NET, Import for JScript.NET, and Imports for VisualBasic.NET). For example:
You can use the using directive in the script editor if the using keyword comes before the first line of executable code. For example:

Script execution

  • In .NET scripts, you call functions from all global modules directly, without the global module name.
  • To skip an optional function parameter, pass System.Type.Missing instead.
  • FlexiCapture objects do not support multithreading.
  • To pause a script, use the Wait method of the IWorkspace interface. The standard Thread.Sleep method is insufficient.

Debugging

  • To debug .NET scripts, use the System.Diagnostics.Debugger.Break method.
  • When debugging .NET scripts, you also need a .pdb file with debugging information. This file can be very large, so avoid storing it in the project with your scripts. When debugging, specify that the script is compiled with debugging information.
  • If you use Microsoft Visual Studio 2010, you can attach to the process where the .NET code runs.