Split example
Split documents using several scripts with global variables.
- Create a workflow with the AutoCapture and OPBarcode components.
- On the General tab of the OPBarcode component configuration dialog box, select the Split on barcode check box, and select External Script in the Using box.
- Click the Scripts button.
- Click Add and enter a file name with the .vbs extension for the first script file.
-
Click the Edit button, and in the Script Editor window
create the first script:
AllValues = AllValues & ";" & CurValue RRV ="AllValues="& AllValues
- Click Compile, save the script, and close the Script Editor.
- In the Script Properties dialog box, select Each page as Run condition.
-
In Script Variables, click the Add button to configure script variables:
Name Scope Initian value Description AllValues
Global
Global variable used by all the scripts that defines how a document should be split.
CurValue
Local
~OPB::PageBarcodes~ Local variable initialized by the ~OPB::PageBarcodes~ RRT.
-
For the second script, repeat steps 4 through 8 using the following script and
variable settings. Script:
Dim values Dim sSplitting Dim bDoSplit values = Split(AllValues,";") sSplitting = "" For i = (LBound(values) + 1) To UBound(values) bDoSplit = False If Len( values(i)) > 0 Then If InStr ( values(i),"5") > 0 Then bDoSplit = True End If End If If Len( sSplitting ) > 0 Then If bDoSplit Then sSplitting = sSplitting & ";" Else sSplitting = sSplitting & "," End If End If sSplitting = sSplitting & CStr(i - LBound(values) - 1) ' page index starts from 0 Next RRV ="OutputPages=" & sSplitting
- Set the Run condition to Each document.
-
Configure the following script variable:
Name Scope Initian value Description AllValues
Global
Value assigned by the first script to define how documents should be split.
The second script is executed for each document and uses the AllValues value to define how to split the documents.
- Save the configuration and run the process.
The document is split on each page with the barcode that contains the "5" character.