> ## 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.

# Processing scripts

> Document and batch processing scripts in ABBYY FlexiCapture change document or batch structure, reorder sections or documents, and log processing progress.

## What it does

Document and batch processing scripts allow you to change the document or batch structure respectively, specify a custom order of sections in the document or order of documents in the batch. Processing scripts can be added when creating a  *(Administrator)* [custom stage](/flexi-capture/project-settings/workflow-stages) *(Developer)* custom stage in the in the Advanced mode of the  *(Administrator)* [Workflow setup](/flexi-capture/project-settings/workflow-project-settings) *(Developer)* Workflow setup.

Both scripts are used to process multiple documents and have the possibility to log the processing progress.

## <a id="documentprocessingscript" />Document processing script

All documents to be processed are passed to this script in turn.

### Parameters

| **Name**   | **Type**                                                                   | **Access** | **Description**                                         |
| ---------- | -------------------------------------------------------------------------- | ---------- | ------------------------------------------------------- |
| Document   | [IDocument](/flexi-capture/appendix/scripts/idocument)                     | Read/write | The document to be processed                            |
| Processing | [IProcessingCallback](/flexi-capture/appendix/scripts/iprocessingcallback) | Read/write | The object for logging the information about processing |

<Note>
  If the task is cancelled, the processing status will change to **false** (similar to using the method **IProcessingCallback.ReportError**).
</Note>

## <a id="batchprocessingscript" />Batch processing script

The input parameters of the script are a batch and a set of documents in it to be processed. The iteration over documents is implemented by the user.

The advantage of the batch processing script is that the methods, which can change the batch structure, are available in it. These methods make it possible to move or delete documents and pages.

### Parameters

| **Name**   | **Type**                                                                   | **Access**                                                                                                                              | **Description**                                         |
| ---------- | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| Batch      | [IBatch](/flexi-capture/appendix/scripts/ibatch)                           | Read-only. Internal[\*](/flexi-capture/appendix/scripts/scripts-handling#asterisk) fields of batch documents and pages are unavailable. | The batch                                               |
| Documents  | [IDocuments](/flexi-capture/appendix/scripts/idocuments)                   | Read/write. For these documents the batch structure can be modified.                                                                    | Documents to be processed                               |
| Processing | [IProcessingCallback](/flexi-capture/appendix/scripts/iprocessingcallback) | Read/write                                                                                                                              | The object for logging the information about processing |

<a id="asterisk" />\* - The internal field requires loading the object into memory.
