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.dllassembly and belong to theABBYY.ScanStationnamespace. This assembly is in the root folder of the Scanning Station.
ABBYY.ScanStation namespace. For example:
Syntax
Access object elements with theWorkspace 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:
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.Missinginstead. - FlexiCapture objects do not support multithreading.
- To pause a script, use the
Waitmethod of the IWorkspace interface. The standardThread.Sleepmethod is insufficient.
Debugging
- To debug .NET scripts, use the System.Diagnostics.Debugger.Break method.
- When debugging .NET scripts, you also need a
.pdbfile 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.
