Creating and Using Scripts
Creating and Using Scripts
A Grooper Script is a program that runs inside of Grooper. It contains instructions (called script code) to make Grooper perform custom tasks. Scripting extends Grooper functionality, and any functionality that Grooper does not already handle out of the box can be accomplished using scripting.
Microsoft Visual Studio 2013
Microsoft .NET Framework 4.5 SDK
Microsoft Visual Studio Tools for Applications 2013
.NET programming experience with Visual Basic
The following Grooper object types (followed by an example of usage) support scripting:
Batch Process - Modify the flow of a Batch Process.
Processing Script - Implement a custom Batch Processing Step.
Data Model - Validate data, customize the Data Review interface, perform custom database lookups.
Data Type - Validate extracted elements.
IP Profile Perform custom image cleanup.
Report - Build custom reports.
Scripted Service - Write a script which executes as a Windows service.
To create a script, follow the directions below.
Go to the scripting tab on the object you want to add scripting to.
Next, click the Create button on the toolbar.
Once you have created the script, select it and then click on Edit in Visual Studio.
Visual Studio will open and from there you can edit your script.
Once you are done editing, save your files in Visual Studio and then close Visual Studio.
After closing Visual Studio, a message box will pop up. Click Yes
Debugging in Visual Studio
To test your script, you can use the debug menu in Visual Studio. This will open an instance of Grooper Administration, Attended Client, or Unattended Client based on what you have specified. Here you can test your scripts functionality.
To change this setting, you can click on the Debug Target: dropdown to change the target you are wanting to debug against.
Compiling the Script
Before Scripts can be used they must be compiled. To compile a script, follow the directions below.
Select the Script that you need to compile and click on Compile.
You can see the status in the lower Output pane in Grooper. When it is done compiling, you will need to restart Grooper Administration for the script to work.
All Grooper scripts interact with Grooper by responding to events. The events available vary depending on the type of object. For example, a Data Model exposes events such as AfterExtraction, FieldEnter, FieldExit, and etc., while a Batch Process exposes events such as BatchCompleting and BatchCompleted. The list of events available for each object type can be found in the Object Reference under the topic for the specific object type.