---
title: MAXScripting for BATCH
slug: maxscripting-for-batch
icon: 🖥️
docTags: 
createdAt: 2022-04-07T14:17:37.000Z
---

The SiNi BATCH script works with headless MAXScripts, meaning they do not have additional code to load dialogue boxes or perform additional actions. The MAXScripts must be capable of running from start to finish with no human interface.&#x20;

### Example One

Below is an example of a headless MAXScript, in this case, the Clean tool.

```none

fn cleanFiles =(
	Si_Clean.DeleteCadBlocks()
	Si_Clean.DeleteNotes()
	Si_Clean.DeleteMotion()
	Si_Clean.DeleteAnimLayers()
	Si_Clean.DeleteRetimers()
	Si_Clean.DeleteEmptyLayers()
)

cleanFiles()
```

The top line is the function (fn) followed by the function name (cleanFiles) and = ( is the start of the function.

The middle lines call each of the functions to perform. In this case, it is calling [SiNiScript](docId\:HhnQH1ds7Bsdd0BPI15sX) MAXScript functions from the [Forensic](docId:4uLoI3c83B_Z5nAQIVwWD) plugin.

) The last bracket closes the function.

cleanFiles() calls the function.

### Example Two

Another example of a simple MAXScript is using the Corona Material Converter from Chaos, but adapting it to run in silent mode.&#x20;

```none
fn covertToCoronaMtls =(
    allVersions = maxVersion()
    filePlace = @"C:\Program Files\Corona\Corona Renderer for 3ds Max\" + (allVersions[8] as string) + @"\Scripts\coronaConverter.ms"
    filein filePlace
    ::CoronaConverterSuppressGui = true
    CoronaConverter.converterSettings.silent = true
    CoronaConverter.convertSceneMtlsMaps()
    CoronaConverter.converterTools.fixCoronaNormalGamma()
    CoronaConverter.converterTools.convertBitmapToCoronaBitmap()
    CoronaConverter.converterSettings.silent = false
    ::CoronaConverterSuppressGui = false
)
covertToCoronaMtls()
```



