Crosscap User Manual
Use of variables
CROSSCAP Manual > Appendix > Use of variables

In many instances within the CROSSCAP application, you may use variables for automation and control. This section provides examples of such variables and their possible uses.

In addition to index variables (which you create yourself, as described in detail in the section on Index fields, in chapter Project settings), there are also many system-wide variables, which are available by default.

Using the example of the project directory template, these variables will be examined in more detail, below.

 

Adding and removing variables

On the left side (Available), select the variable and copy it to the right window (Selected) by using the button labelled with an green arrow to the right. Repeat as often as necessary. If you wish to remove an entry from the right window (Selected), highlight the entry and operate the button labelled with a green arrow to the left.

If a variable is highlighted in the right window (Selected), it may be moved up or down the list of selected variables using the green up or down arrows. This changes the sequence in which variables are executed / evaluated (processing will proceed from the top of the list).

After highlighting one of the selected functions in the right window, the bottom window (Properties of ...) will show detail options for this function.

 

Bar code

Cover pages or routing slips are often used to separate documents or batches. You may use bar code content from a cover page to modify the export directory structure, or use bar code values to label documents.

 

Batch counter

This variable contains the current value of the batch counter. Use it to direct export files from different batches to different directories.

 

Batch index

If a batch index item has been created, you can use this variable to define your directory structure.

 

Batch name template

Creates a subdirectory with the batch name you have specified.

 

Calendar week

Inserts the current calendar week into the path.

 

Computer name

The computer name, also host name, is the unique identifier for the computer in the network. If you want to store generated data according to its source, this variable is suitable.

 

Counter

Primarily, this variable is used to retrieve the current contents of one of the scanner counters (e.g. the InoTec ScaMax M06 features five such internal counters, other brands may offer less or no internal counters).

However, you may also use this variable to access some special CROSSCAP counter types.

The exact meaning of these counters is as follows:

 

Date / Time

This variable is always filled with the current date and time. Use this variable if you want to generate unique, nonrecurrent directories.

 

Directory separator

This is the term used for the familiar backslash "\", which is used in a MS Windows environment to separate directory levels.

<Calendar week><Current project name> will result in a single directory level ...\25Batch001\...

whereas <Calendar week><Directory separator><Current project name> yields ...\25\Batch001\...

 

Discern pages

This option will allow you to differentiate between the front side and the rear side of scanned pages. In this example, the varable cause them to be sent different export directories. Simply add suitable labels for front and rear pages. 

 

Document counter

This variable may be used to create individual folders for each output document.

 

Document index

If a document index item has been created, you may use this variable to modify your directory structure.

 

Domain name

This variable can only be used if the PC has joined a network domain. If multiple domains are available for logging in, this variable permits you to store export data differently, depending on the network domain.

 

Endorser string

If you are using an endorser, you may additionally apply any of the text strings printed on scanned documents to an index file or to document names.

 

Extended image information

This is metadata supplied by the scanning device. The amount of data items available will vary, depending on the device.

If you wish to access several data items (each of which is accessible through the drop-down list labelled Info name), simply add several instances of the Extended image information variable.

See Image Information, for technical image data.

  

Fixed text

Use this variable to add unchanging text strings or single characters (in order to add information or to improve readability). For example, you may change a directory path from Document001 to the more legible Document-001 by inserting a hyphen.

 

Image counter

Indicates the number of images scanned so far, within this batch.


Specify the number of leading zeros to improve legibility of folders or documents, in the file explorer.

Without leading zeros:

1
10
11
12
13
2
3
...

With leading zeros:

001
002
003
...
010
011
012
013


If you want to export each scanned page as a separate document (PDF, TIFF, ...), you will need to add the image counter in the Export settings under Output > File name.

 

Image information

Returns technical data for the current image, such as image resolution or size.

If you wish to access several data items (each of which is accessible through the drop-down list labelled Category), simply add several instances of the Image information variable.

See Extended Image Information, for scanner image metadata.

 

OCR

Use this variable to access text recognized through zonal OCR (see section OCR (Project) in chapter Project settings > Image processing, for more details). Use the name assigned to the OCR definition to select text from a specific detection area.

 

Page index

If a page index item has been created, you may use this variable to modify your directory structure or file naming.

 

Preset

Use this variable to access one of the presets you may have created (see section Presets, in chapter Project settings)

 

Powershell

The Powershell variable allows access to system-wide data items, for use within CROSSCAP batches. If you intend to output results from a powershell script (e.g. as a file), please use the Powershell-Export function, instead (see section Export, chapter Project settings).

The Powershell variable has only a single configuration option, Script text. Clicking the icon for the extended menu (  ) will open a text-editor window:

In the top section of this window, you may enter and edit your powershell script (see code-sample, below).

The lower (help) section contains a listing of all CROSSCAP specific powershell classes. Clicking on one of the class names will display further information about the class and the variables and properties available. Use the small green left arrow (at the bottom left) to return to the original list.

Calling the Powershell variable will run the script defined above. At the end of such a script, the Powershell variable is invariably expected to yield a return string, as the script result. For this reason, a return statement is automatically inserted into the initial script text (see screenshot above), on first use. This return statement must not be deleted or misused for other purposes.

Code-Sample:

The following example employs the PowerShellPageNode class and makes use of variable $CurrentImage and its properties PreEndorserString and IsDuplex:

# Example: The pre endorsed string is 20140512111109 and the last 5 digits represent a counter
# Extract the 5 digit counter from the pre endorsed string 
$counter = [int]$CurrentImage.PreEndorserString.Substring(10, 5)
# Add 1 to the counter
$counter++
# When scanned image is duplex, then add additional 1
if($CurrentImage.IsDuplex)
{
  $counter++
}
# Format string to original format with 5 digit counter
return ( $CurrentImage.PreEndorserString.Substring(0, 10) + "{0:D5}" -f $counter )

 

Software Counter

Use this variable to access one of the (softwarecounters you may have created (see section Counter, in chapter Project settings)

 

Unique ID

Select from three different internal processing identifiers. Since these will be unique, they may be readily used to differentiate between batches.

 

User

Indicates the name of the user currently logged on to the computer. Use this variable to implement a user-dependent data saving scheme.