$finddir » History » Revision 5
Revision 4 (Per Amundsen, 08/12/2015 12:43 PM) → Revision 5/8 (Per Amundsen, 08/12/2015 12:48 PM)
_Added in 1.9.0_ *$finddir(dir,wildcard,N,[depth],[@window|command])* Searches the specified directory and its sub directories for the Nth directory name matching the wildcard specification and returns the full path and directory if it is found. *Parameters* dir - The directory to search. wildcard - Wildcard to search for. N - If N = 0, number of directories, otherwise the Nth directory. [depth] - Maximum folder depth. (optional) [@window|command] - Custom window name to fill with the result or a command to run on each result. (optional) *Properties* .shortfn - Return the path in a [[$shortfn|shortfn]] format. *Example* <pre> ; Print number of sub directories found in $adiircdir. //echo //noop $finddir($adiircdir,*.*,0,echo -ag $finddir($adiircdir,*.*,0) $1-) ; Print the 1st directory found. //echo -ag $finddir($adiircdir,*.*,1) ; Print all sub directories in $adiircdir, when using the command parameter, $1- will hold the path. //noop $finddir($adiircdir,*.*,0,echo -ag $1-) ; Print the 1st directory found. //echo -ag $finddir($adiircdir,*.*,1) </pre>