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

# Sample scripts

> Sample scripts for ABBYY Scanning Station: an automatic scan-and-export station, a full export routine in JScript, and a C# registration data entry window.

## Automatic station

The automatic station scans images, exports the resulting batch, and closes. This sample is written in JScript.

```javascript theme={null}
Scan();
var batch = Batches( Batches.Count - 1 );
Send( batch );
while( !batch.IsExported ) {
    Wait( 100 );
}
Exit();
```

## Full export routine

This sample is written in JScript.

```javascript theme={null}
var fso = new ActiveXObject("Scripting.FileSystemObject");
if( ResultPath == "" ) {
    ResultPath = "C:\\Export";
}
if( !fso.FolderExists( ResultPath ) ) {
    fso.CreateFolder( ResultPath );
}
var params = NewImageSavingOptions();
params.AddProperFileExt = true;
params.Format = "bmp";
var exportedPageCount = CalcExportedPageCount();
NotifyProcessingProgress( exportedPageCount , PageCount - exportedPageCount );
for( i = 0; i < Children.Count; i++ ) {
    var item = Children.Item( i );
    if( item.IsDocument ) {
      if( !item.IsExported ) {
        var docDir = ResultPath + "\\" + item.Name;
        if( !fso.FolderExists( docDir ) ) {
          fso.CreateFolder( docDir );
        }
        for( j = 0; j < item.Children.Count; j++ ) {
          CheckCanceled();
          var page = item.Children.Item( j );
          if( !page.IsExported ) {
            page.SaveAs( docDir + "\\" + page.Name, params );
            exportedPageCount++;
            NotifyProcessingProgress( exportedPageCount , PageCount - exportedPageCount );
            page.IsExported = true;
          }
        }
        item.IsExported = true;
      }
    } else {
      CheckCanceled();
      if( !item.IsExported ) {
        item.SaveAs( ResultPath + "\\" + item.Name, params );
        exportedPageCount++;
        NotifyProcessingProgress( exportedPageCount, PageCount - exportedPageCount );
        item.IsExported = true;
      }
    }
}
```

## Registration data entry window

The following instructions are for C#.

<Steps>
  <Step title="Add the external assemblies">
    Add the following [external assemblies](/flexi-capture/scanning-station/shared/scripts/user-assembly-ss), each as a standard assembly name: `System.Drawing` and `System.Windows.Forms`.
  </Step>

  <Step title="Use the sample script">
    Use the `ScanStation.InputComboBox.cs` script, available at `%PUBLIC%\ABBYY\ABBYY FineReader Server 14.0\Samples\Script`.
  </Step>
</Steps>
