> 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_objects/tabgroups.md).

# TabGroups

The **TabGroups** object lets your script query and modify the configured [Folder Tab Groups](/directory-opus/manual/basic_concepts/the_lister/tabs/tab_groups.md). You can obtain a **TabGroups** object from the [**DOpus**](/directory-opus/manual/reference/scripting_reference/scripting_objects/dopus.md)**.TabGroups** property.

The **TabGroups** object is a collection of [**TabGroup**](/directory-opus/manual/reference/scripting_reference/scripting_objects/tabgroup.md) objects; you can enumerate it to discover the top-level tab groups and folders. Folders can also be enumerated to discover the tab groups and folders they contain, and so on.

| Method Name    | **Arguments**                                                                                                                    | Return Type                                                                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AddChildFolder | *\<object:*[**TabGroup**](/directory-opus/manual/reference/scripting_reference/scripting_objects/tabgroup.md)> or \<string:name> | *object:*[***TabGroup***](/directory-opus/manual/reference/scripting_reference/scripting_objects/tabgroup.md) | Adds a new folder to the list of tab groups. You can either provide a \*\*[TabGroup](/directory-opus/manual/reference/scripting_reference/scripting_objects/tabgroup.md)\*\*object (which has the folder property set to **True**) or the name for the new folder. If the operation succeeds a \*\*[TabGroup](/directory-opus/manual/reference/scripting_reference/scripting_objects/tabgroup.md)\*\*object is returned which represents the new folder. If the operation fails **False** is returned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| AddChildGroup  | *\<object:*[**TabGroup**](/directory-opus/manual/reference/scripting_reference/scripting_objects/tabgroup.md)> or \<string:name> | *object:*[***TabGroup***](/directory-opus/manual/reference/scripting_reference/scripting_objects/tabgroup.md) | Adds a new tab group to the list of tab groups. You can either provide a \*\*[TabGroup](/directory-opus/manual/reference/scripting_reference/scripting_objects/tabgroup.md)\*\*object or the name for the new group. If the operation succeeds a \*\*[TabGroup](/directory-opus/manual/reference/scripting_reference/scripting_objects/tabgroup.md)\*\*object is returned which represents the new tab group. If the operation fails **False** is returned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| DeleteChild    | *\<object:*[**TabGroup**](/directory-opus/manual/reference/scripting_reference/scripting_objects/tabgroup.md)>                   | *none*                                                                                                        | Deletes the child item (folder or tab group).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Save           | *none*                                                                                                                           | *none*                                                                                                        | <p>Saves the tab group list and any changes you have made.<br>Note that this only saves changes made to the object it is called on, and each use of <strong>DOpus.TabGroups</strong> creates a new, independent object. Therefore, you should modify tab groups like this (JScript):<code>var tabGroups = DOpus.TabGroups; var group = tabGroups.AddChildGroup("New Tab Group"); if (!group) DOpus.Output("Group already exists"); else { group.desc = "Example description"; var tabs = group.tabs; tabs.AddTab("C:\\"); tabGroups.Save(); }</code><br>And not like this:<code>// This will not work correctly. var group = DOpus.TabGroups.AddChildGroup("New Tab Group"); if (!group) DOpus.Output("Group already exists"); else { group.desc = "Example description"; group.tabs.AddTab("C:\\"); DOpus.TabGroups.Save(); }</code><br>The second example will not work because the last line creates a second, unrelated snapshot of the current state, which is unaffected by the unsaved changes to the first snapshot, and then saves the second snapshot without making any changes to it.</p> |
| Update         | *none*                                                                                                                           | *none*                                                                                                        | Updates the **TabGroups** object to reflect any changes made through the Preferences user interface.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
