# It is possible to select all subfolders and files only in expanded folder?

**URL:** <https://resource.dopus.com/t/it-is-possible-to-select-all-subfolders-and-files-only-in-expanded-folder/56785>\
**Category:** Help & Support\
**Created:** [August 7, 2025, 5:45pm UTC](https://resource.dopus.com/t/it-is-possible-to-select-all-subfolders-and-files-only-in-expanded-folder/56785 "2025-08-07T17:45:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![errante](https://resource.dopus.com/user_avatar/resource.dopus.com/errante/32/61692_2.png) [@errante](https://resource.dopus.com/u/errante)\
**Post date:** [August 7, 2025, 6:53pm UTC](https://resource.dopus.com/t/it-is-possible-to-select-all-subfolders-and-files-only-in-expanded-folder/56785/2 "2025-08-07T18:53:18Z")

</div>

For simplicity, you could use something like this in a button to select **all** the nested items. Though it won't work in places like collections, libraries, etc.

`=return "Select DESELECTNOMATCH FILTERDEF =return Count("""+source+""")+1 < Count(fullpath);";`

This other will work for the selected folder only:  
`=return "Select DESELECTNOMATCH FILTERDEF =return isParent("""+selpath+""",fullpath) && Count("""+selpath+""")<Count(fullpath);";`

> [@How to use buttons and scripts from this forum](https://resource.dopus.com/t/how-to-use-buttons-and-scripts-from-this-forum/3546):
>
> This post explains how to add buttons to toolbars and menus, and also applies to raw commands for things like standalone hotkeys. For how to use Script Add-Ins, please scroll down to the post below this one. See Also: The manual has more detail in…

Also, check out [this script add-in](https://resource.dopus.com/t/expand-folders-command/48233), once installed, you could use something like this to expand the selected folders and select all their contents in one go.  
`ExpandFolders EXPAND=top SELECT`

For something more specific, you'd need to use scripting, which basically lets you do exactly what you want.

---

_[View the full topic](https://resource.dopus.com/t/it-is-possible-to-select-all-subfolders-and-files-only-in-expanded-folder/56785)._
