> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IWorkSpace

> IWorkSpace is the root scripting object of the Scanning Station: add batches and pages, scan, find barcodes, and send batches to FlexiCapture, folder, or FTP.

## What it does

Represents the station workspace. The object is available in scripts with the keyword `this`.

## Methods

| **Definition**                                                                                                                                                                                                                                                                                                         | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AddBatch( target: [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item), name: string, type: [IBatchType](/flexi-capture/scanning-station/shared/scripts/batch-type) ): [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item)                                      | Adds a batch. A new batch is added after the batch specified in the **target** parameter. To add the batch to the beginning of the list, set the **target** parameter to "Nothing" (VBScript: `me.AddBatch Nothing, "batch 1", me.BatchTypes.Item(0)`). If the **name** parameter is empty, the batch name is generated according to the batch settings.                                                                                                                                                             |
| AddDocument( page: [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item), name: string ): [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item)                                                                                                                    | Inserts the page into a new document. If the page is already included in the document, three documents are created: one with the previous pages, one with the current page, and one with the following pages. If the **name** parameter is empty, the document name is generated according to the batch settings.                                                                                                                                                                                                    |
| AddPages( fileName: string, target: IWorkspaceItem, \[optional] inside: bool ): [IWorkspaceItems](/flexi-capture/scanning-station/shared/scripts/workspace-items)                                                                                                                                                      | Adds pages from a file. Pages can be added after the **target** item at the same level or inside the **target** item at the beginning of the list. A target can be a batch, document or page. If the target is a batch, the **inside** parameter must be "true" (pages are added to the beginning of the batch). If the target is a page, the **inside** parameter must be "false" (pages are added after the specified page). If the target is a document, the **inside** parameter can be both "true" and "false". |
| ClearSelection()                                                                                                                                                                                                                                                                                                       | Clears the current selection                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| DeleteItem( item: [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item) )                                                                                                                                                                                                                    | Deletes a specified item                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| DetectPageEmpty( page: [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item), \[optional] options: [IEmptyPageDetectionOptions](/flexi-capture/scanning-station/shared/scripts/emptypage-detectoptions) ): bool                                                                              | Detects an empty page                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Exit(): bool                                                                                                                                                                                                                                                                                                           | Finishes the station work                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| FindPageBarcodes( page: [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item), \[optional] options: [IBarcodeFindingOptions](/flexi-capture/scanning-station/shared/scripts/barcode-findingoptions) ): [IScriptFoundBarcodes](/flexi-capture/scanning-station/shared/scripts/found-barcodes) | Searches for barcodes on the page                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| NewBarcodeFindingOptions(): [IBarcodeFindingOptions](/flexi-capture/scanning-station/shared/scripts/barcode-findingoptions)                                                                                                                                                                                            | Sets barcode finding options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| NewEmptyPageDetectionOptions(): [IEmptyPageDetectionOptions](/flexi-capture/scanning-station/shared/scripts/emptypage-detectoptions)                                                                                                                                                                                   | Sets options for detecting empty pages                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| NewImageSavingOptions(): [IImageSavingOptions](/flexi-capture/scanning-station/shared/scripts/saving-options)                                                                                                                                                                                                          | Sets image saving options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| NewPageRect(): [IPageRect](/flexi-capture/scanning-station/shared/scripts/pagerect)                                                                                                                                                                                                                                    | Defines a page rectangle                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| RunScript( scriptName: string, \[optional] info: string, \[optional] skipShowError: bool ): [IScriptResult](/flexi-capture/scanning-station/shared/scripts/script-result)                                                                                                                                              | Runs the script execution                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Scan( \[optional] folder: string )                                                                                                                                                                                                                                                                                     | Starts scanning with the settings of the current batch type                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Send( batch: [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item) )                                                                                                                                                                                                                         | Exports the batch with the settings of the current batch type                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| SendByScript( batch: [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item), skipShowExportOptions: bool )                                                                                                                                                                                    | Sends the batch by using a script with the settings of the current batch type. The **skipShowExportOptions** parameter specifies whether to display the Export Options dialog box before sending the batch.                                                                                                                                                                                                                                                                                                          |
| SendToFC( batch: [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item), \[optional] skipShowExportOptions: bool )                                                                                                                                                                            | Sends the batch to ABBYY FlexiCapture with the settings of the current batch type. The **skipShowExportOptions** parameter specifies whether to display the Export Options dialog box before sending the batch.                                                                                                                                                                                                                                                                                                      |
| SendToFolder( batch: [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item), \[optional] skipShowExportOptions: bool )                                                                                                                                                                        | Exports the batch to a folder with the settings of the current batch type. The **skipShowExportOptions** parameter specifies whether to display the Export Options dialog box before sending the batch.                                                                                                                                                                                                                                                                                                              |
| SendToFTP( batch: [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item), \[optional] skipShowExportOptions: bool )                                                                                                                                                                           | Exports the batch to an FTP folder with the settings of the current batch type. The **skipShowExportOptions** parameter specifies whether to display the Export Options dialog box before sending the batch.                                                                                                                                                                                                                                                                                                         |
| SetPageImage( page: [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item), fileName: string, \[optional] filePageIndex: int )                                                                                                                                                                | Changes the image of the page                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Wait( millisecond: int )                                                                                                                                                                                                                                                                                               | Suspends the script execution for the specified time (in milliseconds)                                                                                                                                                                                                                                                                                                                                                                                                                                               |

## Properties

| **Name**         | **Type**                                                                              | **Access** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------------- | ------------------------------------------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ActiveBatch      | [IWorkspaceItem](/flexi-capture/scanning-station/shared/scripts/workspace-item)       | Read/write | The active batch. For some event scripts (for example, **On batch sending** and **On batch sent**), returns null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Batches          | [IWorkspaceItems](/flexi-capture/scanning-station/shared/scripts/workspace-items)     | Read-only  | Batches                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| BatchTypes       | [IBatchTypes](/flexi-capture/scanning-station/shared/scripts/batch-types)             | Read-only  | Batch types                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| CurrentBatchType | [IBatchType](/flexi-capture/scanning-station/shared/scripts/batch-type)               | Read/write | The current batch type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Result           | [IScriptResult](/flexi-capture/scanning-station/shared/scripts/script-result)         | Read-only  | The result of the script execution                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ScriptEnvInfo    | string                                                                                | Read-only  | Environmental information about conditions on which the script is triggered. For scripts triggered automatically before or after export, its value is `<exportType> <taskID>`, where `exportType` can be "Folder", "FTP", "FC", "RS" or "Script" and `taskID` is the export task identifier. For scripts triggered automatically before or after page transformation, the property takes one of the following values: `Rotate <angle>`, `FlipHorizontal`, `FlipVertical`, `Invert`, `ConvertToBW`, `Deskew`, `Despeckle`, `Erase <rectLeft> <rectTop> <rectRight> <rectBottom>`, `Crop <rectLeft> <rectTop> <rectRight> <rectBottom>`, `SplitHorizontal <pos>`, `SplitVertical <pos>`, `ChangeResolution <newRes>`, `Scale <ratio>`, `FreeScale <newWidth>, <newHeight>, <newRes>`. |
| ScriptItems      | [IWorkspaceItems](/flexi-capture/scanning-station/shared/scripts/workspace-items)     | Read-only  | Items for which the script is called. The returned value is different for different events. For the events **On station started** and **On station closing**, the returned value is empty. For the event **On scan completed**, the returned value is a list of pages added during the scanning session. For other events, the returned value is a batch, a document or a page depending on the event. When the script is launched by an explicit user command, a collection of currently selected items is returned.                                                                                                                                                                                                                                                               |
| ScriptProperties | [IScriptProperties](/flexi-capture/scanning-station/shared/scripts/script-properties) | Read-only  | Script properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Selection        | [IWorkspaceItems](/flexi-capture/scanning-station/shared/scripts/workspace-items)     | Read-only  | The current selection. Contains batches only, documents only or pages only.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| SourceID         | string                                                                                | Read-only  | The station identifier                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
