FolderItem Reference
Reference for the FolderItem object, which represents a single file, folder, or virtual-folder item handled by Tablacus Explorer.
Notation: P = property, M = method.
Table of Contents
- Overview
- How to Obtain
- Tablacus Explorer-Specific Members
- Members Compatible with the Standard Windows FolderItem
- Standard Windows FolderItem Members (Delegated)
- Additional Notes
- Examples
1. Overview
An object that extends the shell's FolderItem interface. In addition to Tablacus's own members, the members of the standard Windows FolderItem / FolderItem2 can be used as they are (the latter are delegated to the Windows implementation).
2. How to Obtain
| How to obtain | Returns |
|---|---|
FV.FolderItem |
The current folder |
FV.Item(i) / FV.FocusedItem |
An item in the view |
FolderItems.Item(i) |
An item in the collection (FolderItems Reference) |
api.ILCreateFromPath(path) |
A FolderItem from a path |
api.ILGetParent(item) |
The FolderItem of the parent folder |
api.SHParseDisplayName(name) |
A FolderItem from a display name or parsing path |
api.SHSimpleIDListFromPath(path, attr, [date], size) |
A FolderItem with a simple IDList from a path |
Each element of FV.Items() / FV.SelectedItems() |
A FolderItem |
| Event arguments | The Item argument of OnBeforeNavigate and similar events |
3. Tablacus Explorer-Specific Members
| Name | Kind | Description |
|---|---|---|
Alt |
P | The alternative ItemIDList (the result of OnTranslatePath, or the original IDList if there is none). Assigning to it clears the "unavailable" state |
Unavailable |
P | Elapsed time (ms) of the "unavailable" state. Assigning a non-zero value starts measuring from that moment, and assigning 0 clears it. 0 if the item is not unavailable |
Id |
P (read-only) | Session ID (integer). Used to identify FolderItems enumeration and to check consistency in FV.AddItem |
Enum |
P/M | A property that holds an enumeration object (assigning to it registers it as the internal enumeration object). |
4. Members Compatible with the Standard Windows FolderItem
| Name | Kind | Description |
|---|---|---|
Path |
P (read-only) | The full path. C:\Dir\a.txt on the file system, and a parsing path in the form ::{GUID} for virtual folders |
Name |
P | The display name within the folder (SHGDN_INFOLDER). Assigning to it renames the item. If OnSetName is registered, it is called first, and if it returns a value, that result is used. If the name consists only of a leading period such as .xxx, a trailing . is added before it is set |
5. Standard Windows FolderItem Members (Delegated)
These are passed internally to the Windows shell object. The main members are as follows.
| Name | Kind | Description |
|---|---|---|
IsFolder |
P | Whether it is a folder (true/false) |
IsFileSystem |
P | Whether it is an object on the file system |
IsLink |
P | Whether it is a shortcut |
IsBrowsable |
P | Whether it can be opened (navigated into) |
Size |
P | Size (bytes) |
Type |
P | Type string (such as "Text Document") |
ModifyDate |
P | Modified date and time (can also be changed by assignment) |
GetFolder |
P | Returns a Folder object (child items can be enumerated with Items()) |
GetLink |
P | The ShellLinkObject of a shortcut |
Parent |
P | The parent |
Application |
P | Shell.Application |
Verbs() |
M | List of verbs (context menu items) |
InvokeVerb([verb]) |
M | Executes a verb (the default verb if omitted) |
InvokeVerbEx(verb, args) |
M | Executes a verb with arguments |
ExtendedProperty(name) |
M | Gets a property value ("System.Size", "{GUID} pid", etc.). For System.Link.TargetParsingPath, if the result is empty, the target of a junction or symbolic link is filled in and returned |
The range of available members differs depending on the Windows version (the FolderItem2 family requires Windows 7 or later).
6. Additional Notes
- A
FolderItemcreated from a path string or the like does not have an IDList at that point; it is resolved when needed. An item that fails to resolve is kept as a path string. - For items that do not exist or cannot be accessed, delegated members fail with
E_FAILor similar and return no value. NameandPathcan be obtained without an IDList even on their own.apifunctions that accept a FolderItem (GetDisplayNameOf,GetAttributesOf,ILIsEqual, and so on) automatically accept a FolderItem, a path string, an IDList, or an object that hasPath.
7. Examples
// Create a FolderItem from a path and navigate to it
const item = api.ILCreateFromPath("C:\\Windows");
FV.Navigate(item, SBSP_SAMEBROWSER);
// Basic properties
const path = item.Path;
const isFolder = item.IsFolder;
// Rename
item.Name = "newname.txt";
// Extended property
const size = item.ExtendedProperty("System.Size");
// Parent folder
const parent = api.ILGetParent(item);