Splitting example #3
Split documents using several scripts with global variables.
- Create a workflow with the AutoCapture and Barcode components.
- On the General tab of the Barcode 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:
Example
If Len(AllValues) > 0 Then AllValues = AllValues & ";" & CurValue Else AllValues = CurValue End If 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:
Variable Description AllValues Global variable used by all the scripts that defines how a document should be split. CurValue Local variable initialized by the ~LTB::PageBarcodes~ RRT. -
For the second script, repeat steps 4 through 8
using the following script and variable settings.
Example Script:
Dim values Dim sSplitting Dim bDoSplit values = Split(AllValues,";") sSplitting =" " For i = LBound(values) 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) Next RRV ="OutputPages="& sSplitting
Set the Run condition to Each document and configure the following script variable:Variable Description AllValues Value assigned by the first script to define how documents should be split. The second script will be executed for each document and use the AllValues value to define how a document should be split. - Save the configuration and run the process.
The document will be split on each page with the barcode that contains the "5" character.