> For the complete documentation index, see [llms.txt](https://wiki.redmodding.org/wolvenkit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.redmodding.org/wolvenkit/wolvenkit-app/usage/scripting-with-wscript.md).

# Scripting with wscript

Wolvenkit is scriptable using javascript and its internal API. With it you can automate tasks such as exporting, as well as make changes to files programmatically.

{% hint style="info" %}
For documentation of the [Script Manager](/wolvenkit/wolvenkit-app/tools/script-manager.md), check the corresponding sub-page.
{% endhint %}

## Adding Scripts

See [Script Manager](/wolvenkit/wolvenkit-app/tools/script-manager.md) -> [Script Manager](/wolvenkit/wolvenkit-app/tools/script-manager.md#adding-scripts)

## Script file path

Any .wscript files you have created or edited will be stored in the following location:

```
%APPDATA%\REDModding\WolvenKit\WScript
```

You can delete or edit them via [Script Manager](/wolvenkit/wolvenkit-app/tools/script-manager.md).

## Editing Scripts

The editor shows your source code with code formatting and includes code suggestion for the Wolvenkit api.

<figure><img src="/files/RIIkr7qglxgIaemZMdPa" alt=""><figcaption></figcaption></figure>

For questions or suggestions about the scripting interface please visit the #wolvenkit-scripts channel on the [Discord server](/wolvenkit/help/community.md).

## API Commands

Documentation of the API can be found at

{% content-ref url="/pages/taPhqTzUsPxivZkWLvR6" %}
[WScript API Documentation](/wolvenkit/wolvenkit-app/usage/wscript-api-docs.md)
{% endcontent-ref %}

## Utility Functions

There is also a utility library called Logger.wscript shipped with wolvenkit that assists with writing messages to the wolvenkit Log. It can be included with the following statement:

```javascript
import * as Logger from 'Logger.wscript';
```

it provides the following functions:

**Logger.Info(obj)**

Prints the supplied object or text in yellow in the log window.

**Logger.Warning(obj)**

Prints the supplied object or text in purple in the log window.

**Logger.Error(obj)**

Prints the supplied object or text in red in the log window.

**Logger.Success(obj)**

Prints the supplied object or text in light blue in the log window.

**Logger.Debug(obj)**

Prints the supplied object or text only to the log file.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.redmodding.org/wolvenkit/wolvenkit-app/usage/scripting-with-wscript.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
