# OnScriptColumn

The **OnScriptColumn** event is the entry point for a [custom column](https://chaoses-ib.gitbook.io/directory-opus/manual/scripting/example_scripts/adding_a_new_column) added by a [script add-in](https://chaoses-ib.gitbook.io/directory-opus/manual/scripting/script_add-ins). The actual name of the event is defined by the script itself, when the command is added via the [**ScriptInitData**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/scriptinitdata)**.AddColumn** method - **OnScriptColumn** is merely a placeholder name.

| **Method Name:**   | OnScriptColumn                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Argument Type:** | [**ScriptColumnData**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/scriptcolumndata)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Return Type:**   | *none*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Description:**   | <p>When a script add-in adds a new column using <a href="../scripting_objects/scriptinitdata"><strong>ScriptInitData</strong></a><strong>.AddCommand</strong>, it specifies the name of its entry point with the <strong>ScriptColumn.method</strong> property. When Opus wants to retrieve the value of the column for a particular file or folder, Opus will call that method within your script.<br>The <a href="../scripting_objects/scriptcolumndata"><strong>ScriptColumnData</strong></a><strong>.item</strong> property provides information about the file or folder in question, and the <strong>col</strong> property identifies the column you should return data for (in case you use the one method for more than one columns).</p><p>The return value from this event is ignored - instead, you should return the column data (and optionally, sorting and grouping information) by setting the appropriate values in the <a href="../scripting_objects/scriptcolumndata"><strong>ScriptColumnData</strong></a> object.</p> |


---

# Agent Instructions: 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://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_events/onscriptcolumn.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.
