---
title: "getTabSelItem"
canonical: "https://help.vicon.com/space/ShogunPost117/376966973/getTabSelItem"
format: markdown
---
# Description

Gets the index of the specified tab for further manipulation

## Functional area

User Window

# Command syntax

## Syntax

|  |
| --- |
| `getTabSelItem userControlID` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `userControlId` | int | yes | ID of the control to be queried. |

### Flags

None

> Macro (scroll-pagebreak)

## Return value

integer

## Examples

```plaintext
// Create a tab and add and additional tab to the main tab.
int $windowId;
int $mainTab;
 
// First create a User Window to place the Control on
$windowId = `createWindow "MyWindow"`;
  
//create a main tab controller then add a second tab to the main tab
$mainTab = `createTab $windowId "Main" "Second" "Third" -sel 2`;
int $secondTab = `addTab $mainTab "Fourth"`;
int $activeTab = `getTabSelItem $mainTab`;
print $activeTab;
```

# Additional information

## Related commands

- [addTab](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost117/pages/376965245)
- [createTab](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost117/pages/376965755)
- [deleteAllTabItems](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost117/pages/376965839)
- [deleteTabItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost117/pages/376965911)
- [getTabItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost117/pages/376966967)
- [selectTabItem](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost117/pages/376967969)
- [setTabHandler](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost117/pages/376968497)