> For the complete documentation index, see [llms.txt](https://chaoses-ib.gitbook.io/directory-opus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_events/onclosetab.md).

# OnCloseTab

The **OnCloseTab** event can be implemented by a [script add-in](/directory-opus/manual/scripting/script_add-ins.md) to receive notification when a tab is closed in a Lister.

| **Method Name:**   | OnCloseTab                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Argument Type:** | [**CloseTabData**](/directory-opus/manual/reference/scripting_reference/scripting_objects/closetabdata.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Return Type:**   | *bool*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Description:**   | <p>The <strong>CloseTabData.tab</strong> property identifies the tab that is closing. You can return <strong>True</strong> from this event to prevent the tab from closing, or <strong>False</strong> (which is the default) to allow it to close.</p><p>Note that when a Lister closes this event is <strong>not</strong> triggered for each of its tabs - the <a href="/directory-opus/manual/reference/scripting_reference/scripting_events/oncloselister.md"><strong>OnCloseLister</strong></a> event provides notification when a Lister closes, and all the tabs in that Lister as discoverable through the <strong>CloseListerData.lister.tabs</strong> property.</p> |
