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

# Batch structure change (page added/page deleted/document added/document deleted)

> React to batch structure changes in FlexiCapture scripts when pages or documents are added or deleted, for example to count incoming pages.

## What it does

The handler of this event can be used if you need to do some manipulations on the batch, the document or the page depending on a new image. For example, to count the number of pages added to the batch to ensure that no pages are missing.

## When it is launched

The script is launched upon adding pages (or documents) or prior to deleting them.

<Note>
  Deleting a document does not initiate the event of deleting document pages.
</Note>

## Parameters

<table width="100%"><thead><tr><th style={{textAlign: 'left'}}><p><strong>Name</strong></p></th><th style={{textAlign: 'left'}}><p><strong>Type</strong></p></th><th style={{textAlign: 'left'}}><p><strong>Access</strong></p></th><th style={{textAlign: 'left'}}><p><strong>Description</strong></p></th></tr></thead><tbody><tr><td><p>Batch</p></td><td><p><a href="/flexi-capture/appendix/scripts/ibatch">IBatch</a></p></td><td><p>Internal<a href="/flexi-capture/appendix/scripts/batchcontents-modify#asterisk">\*</a> fields of batch documents and pages are unavailable</p></td><td><p>The batch being manipulated</p></td></tr><tr><td><p>Document (or Page)</p></td><td><p><a href="/flexi-capture/appendix/scripts/idocument">IDocument</a> (or <a href="/flexi-capture/appendix/scripts/ipage">IPage</a>)</p></td><td><p>External fields of the changed document (or page) can be modified.</p><p>Access to the deleted document (or page) and other documents and pages of the batch is read-only.</p></td><td><p>The item being deleted (or added).</p></td></tr></tbody></table>

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