# Tab

The **Tab** object represents a folder tab in a Lister (even if the tab control isn't currently displayed, a Lister always has at least one open tab). You can obtain a collection of **Tab** objects from a [**Lister**](lister) object. **Tab** objects are also used with the [**Command**](command) and [**Func**](func) objects, and if a command results in new tabs being opened, the [**Results**](results) object.

| Property Name    | Return Type                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| all              | _object:_[**Items**](items)             | <p>Returns an <a href="items"><strong>Items</strong></a> object that represents all the files and folders currently displayed in this tab.</p><p>Note: The first time a script accesses this property (and all the other properties that return an <a href="items"><strong>Items</strong></a> object), a snapshot is taken of all the appropriate items. If the script then makes changes to those items (e.g. by creating a new file, modifying the selection, etc), these changes will not be reflected by the collection. To re-synchronize the collection call the <strong>Update</strong> method on the object.</p> |
| backlist         | _collection:_[**Path**](path)           | Returns a collection of [**Path**](path) objects that represents the paths in the "backward" history list for this tab (i.e. the folders you would get to by clicking the _Back_ button).                                                                                                                                                                                                                                                                                                                                                                                                                                |
| color            | _string_                                | Returns the tab's assigned color (if one has been assigned via, for example, the **Go TABCOLOR** command). The color is returned as a string in R,G,B format.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| crumbpath        | _object:_[**Path**](path)               | Returns the current path from the tab's breadcrumb control (if it has one), including any ghost path.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| dest             | _bool_                                  | <p>Returns <strong>True</strong> if this tab is currently the <a href="../../../basic_concepts/source_and_destination">destination</a>, and <strong>False</strong> otherwise.</p><p>Note that you cannot always assume a tab is the source if it is not the destination. Use the separate <strong>source</strong> property for that.</p>                                                                                                                                                                                                                                                                                 |
| dirs             | _object:_[**Items**](items)             | Returns an [**Items**](items) object that represents all the folders currently displayed in this tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| dirty            | _bool_                                  | Returns **True** if the tab is marked as dirty, indicating its list of contents may be out of date. This can happen if the tab is in the background and the user has turned off the **Preferences / Folder Tabs / Options / Process file changes in background tabs** option.                                                                                                                                                                                                                                                                                                                                            |
| displayed\_label | _string_                                | Returns the currently displayed label of this tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| filegroups       | _collection:_[**FileGroup**](filegroup) | Returns a collection of [**FileGroup**](filegroup) objects that represents all the file groups in the tab (when the tab is grouped). You can use the **format.group\_by** property to test if the tab is grouped or not.                                                                                                                                                                                                                                                                                                                                                                                                 |
| files            | _object:_[**Items**](items)             | Returns an [**Items**](items) object that represents all the files currently displayed in this tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| format           | _object:_[**Format**](format)           | Returns a [**Format**](format) object representing the current folder format in this tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| forwardlist      | _collection:_[**Path**](path)           | Returns a collection of [**Path**](path) objects that represents the paths in the "forward" history list for this tab (i.e. the folders you would get to by clicking the _Forward_ button).                                                                                                                                                                                                                                                                                                                                                                                                                              |
| hidden           | _object:_[**Items**](items)             | Returns an [**Items**](items) object that represents all the files and folders currently hidden from this tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| hidden\_dirs     | _object:_[**Items**](items)             | Returns an [**Items**](items) object that represents all the folders currently hidden from this tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| hidden\_files    | _object:_[**Items**](items)             | Returns an [**Items**](items) object that represents all the files currently hidden from this tab                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| highlighted      | _object:_[**Items**](items)             | Returns an [**Items**](items) object that represents all the files and folders currently displayed in this tab that have one or more cells [highlighted](../../../basic_concepts/selecting_files/selecting_cells).                                                                                                                                                                                                                                                                                                                                                                                                       |
| label            | _string_                                | Returns the current assigned tab label. Note that this may be an empty string if no custom label has been assigned. The **displayed\_label** property returns the currently displayed label in all cases.                                                                                                                                                                                                                                                                                                                                                                                                                |
| linktab          | \*object:\***Tab**                      | If this tab is linked to another tab, returns a **Tab** object representing the linked tab. If this tab is not linked this property returns **0**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| lister           | _object:_[**Lister**](lister)           | Returns a [**Lister**](lister) object representing the parent Lister that owns this tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| lock             | _string_                                | Returns the current lock state of the tab; one of "off", "on", "changes", "reuse".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| navlock          | _bool_                                  | Returns **True** if this tab is linked in Navigation Lock mode. This property does not exist if the tab is not linked, so make sure you check the value of **linktab** first.                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| path             | _object:_[**Path**](path)               | Returns the current path shown in this tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| quickfilter      | _object:_[**QuickFilter**](quickfilter) | Returns a [**QuickFilter**](quickfilter) object providing information about the state of the quick filter in this tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| right            | _bool_                                  | Returns **True** if this tab is currently on the right or bottom side of a dual-display Lister, and **False** otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| selected         | _object:_[**Items**](items)             | Returns an [**Items**](items) object that represents all the selected files and folders currently displayed in this tab. Note that if [checkbox mode](../../../basic_concepts/selecting_files/selecting_with_the_mouse_and_keyboard/checkbox_mode) is turned on in the tab, this will be a collection of checked items rather than selected.                                                                                                                                                                                                                                                                             |
| selected\_dirs   | _object:_[**Items**](items)             | Returns an [**Items**](items) object that represents all the selected folders currently displayed in this tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| selected\_files  | _object:_[**Items**](items)             | Returns an [**Items**](items) objects that represents all the selected files currently displayed in this tab                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| selstats         | _object:_[**TabStats**](tabstats)       | Returns a [**TabStats**](tabstats) object that provides various information about the tab, including the number of files, number of selected files, total size of selected files, etc. The "selected" counts provided by this object take [checkbox mode](../../../basic_concepts/selecting_files/selecting_with_the_mouse_and_keyboard/checkbox_mode) into account (that is, if checkbox mode is currently turned on, the counts will be for checked files rather than for selected files).                                                                                                                             |
| source           | _bool_                                  | <p>Returns <strong>True</strong> if this tab is currently the <a href="../../../basic_concepts/source_and_destination">source</a>, and <strong>False</strong> otherwise.</p><p>Note that you cannot always assume a tab is the destination if it is not the source. Use the separate <strong>dest</strong> property for that.</p>                                                                                                                                                                                                                                                                                        |
| stats            | _object:_[**TabStats**](tabstats)       | Returns a [**TabStats**](tabstats) object that provides various information about the tab, including the number of files, number of selected files, total size of selected files, etc. Unlike **selstats**, this object does not take [checkbox mode](../../../basic_concepts/selecting_files/selecting_with_the_mouse_and_keyboard/checkbox_mode) into account (so the "selected" counts will refer to selected rather than checked files).                                                                                                                                                                             |
| vars             | _object:_[**Vars**](vars)               | This [**Vars**](vars) object represents all defined variables with _tab scope_ (that are scoped to this tab).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| visible          | _bool_                                  | Returns **True** if this tab is currently visible (i.e. it is the active tab in either file display), and **False** otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

| Method Name           | **Arguments**                                                                                                                                               | Return Type                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CloseFAYT             | _none_                                                                                                                                                      | _none_                        | Call this method from a [FAYT extension](../../../scripting/example_scripts/extending_the_fayt) script to forcibly close the FAYT field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Dlg                   | _none_                                                                                                                                                      | _object:_[**Dialog**](dialog) | Creates a new [**Dialog**](dialog) object, that lets you display dialogs and popup menus. The dialog's **window** property will be automatically assigned to this tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| GetFocusItem          | _none_                                                                                                                                                      | _object:_[**Item**](item)     | <p>Returns an <a href="item"><strong>Item</strong></a> object representing the file or folder which has focus in the tab.</p><p>The focus item is typically indicated by an outline around its name, and is usually the last item which was clicked on, or the last item which was moved to with the keyboard. The focus item is often also selected, but not always; focus and selection are two different things.</p><p>If no focus item exists, or if the focus item is a special file or folder, such as <em>This PC</em>, which cannot be represented by an <strong>Item</strong> object, then this method does not return an object. (In JScript, test if the result <em><strong>== null</strong></em> and in VBScript test if the result <em><strong>is nothing</strong></em>.)</p>                                 |
| Notify                | <p>&#x3C;string:type><br>&#x3C;string:msg><br>[&#x3C;int:timeout>]</p>                                                                                      | _bool_                        | <p>Displays a notification message associated with this tab.</p><p>Currently the only defined type is "status", which displays the message in the status bar.</p><p>The <em>msg</em> string will be displayed in the status bar when the tab is active. The <em>timeout</em> value lets you specify an optional timeout (in milliseconds) after which the message will automatically be removed. If no timeout is specified the user needs to click the message to dismiss it.</p>                                                                                                                                                                                                                                                                                                                                         |
| Update                | _none_                                                                                                                                                      | _none_                        | When a script accesses particular properties of a **Tab** object, a snapshot is taken of the tab's state. For example, if you ask for the **selected\_files** property, the list of selected files is calculated and then stored in memory. This can speed things up, and also means you don't have to worry about the list changing under you as you work through it. If the script then makes changes to the tab (e.g. it selects files, creates a new folder, etc.), these changes will not be reflected by the cached snapshot(s) if you access the same properties on the same tab object again. To clear the cached snapshots and re-synchronize the object with the tab's current state, call the **Tab.Update** method.                                                                                            |
| UpdateFAYTSuggestions | <p><em>array</em><br>or <a href="vector"><em><strong>vector</strong></em></a><em>:string</em> or <em>object:</em><a href="map"><strong>map</strong></a></p> | _none_                        | <p>When you're implementing a <a href="../../../scripting/example_scripts/extending_the_fayt">FAYT extension</a> script, you can call this method at any time to update the list of suggestions shown to the user.</p><p>You can provide an array or <a href="vector"><strong>vector</strong></a> of strings, or a <a href="map"><strong>map</strong></a> of string/string pairs.</p><p>When providing a <a href="map"><strong>map</strong></a> each key represents the text that will be inserted if selected by the user, and the value represents a hint or description that's shown in a separate column in the suggestion list.</p><p>When providing an array or <a href="vector"><strong>vector</strong></a> of strings, you can provide the second column description by tab-separating it from the main value.</p> |
