<div class="meta" robots="noindex">

</div>

Method

# FolderItem.TrueItem

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `FolderItem.ChildAt<folderitem.childat>` as a replacement.

</div>

## Description

If this **FolderItem** is a directory, *Index* is an element in a one-based array of FolderItems in this directory.

## Notes

TrueItem returns the actual FolderItem, even if it is an Alias or Shortcut. To get the FolderItem pointed to by the alias/shortcut, use `FolderItem.ChildAt<folderitem.childat>`.

You can also use code like this to look up the destination file:

``` xojo
item = item.Parent.Child(item.Name)
```

Be aware that the returned FolderItem object may be *nil*, e.g. if current file permissions deny access to it.

<div class="note">

<div class="title">

Note

</div>

If you want to iterate over the contents of a directory, make sure to *always* do this starting at index 1, then increasing the index up to the value of FolderItem.Count. Avoid iterating backwards (using a `For...Next</api/language/loops/for...next>` loop with DownTo or Step -1), because that can potentially become extremely slow with larger directories, especially on macOS. To see how to delete the contents of a folder, see the example in `FolderItem.Remove<folderitem.remove>`.

</div>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

### Performance considerations

Avoid calling this function several times as it is costly in processing time. If you need to get several properties of an item, get it once and store it in a variable of type FolderItem, then access that variable instead.

## Sample code

This example populates a `ListBox</api/deprecated/listbox>` with the <span class="title-ref">TrueItem</span> elements of the user's Desktop directory.

``` xojo
Dim dir As FolderItem = SpecialFolder.Desktop
Dim dirCount As Integer = dir.Count
For itemIdx As Integer = 1 To dirCount
  Dim item As FolderItem = dir.TrueItem(itemIdx)
  If item <> Nil Then
    ListBox1.Addrow(item.Name)
  End If
Next
```

## Compatibility

All project types on all supported operating systems.
