ui.selectdir([prompt])

Displays a shell dialog box to choose a folder.

Notes

  • The dialog box only uses the current Windows system theme

Parameters

prompt

An optional string that gives the user indication for the selection.

Return value

The function returns the selected folder as a Directory object or nil if the user selected none.

Example

local ui = require "ui" -- open a dialog to choose an existing folder local dir = ui.selectdir("Please select a folder to count its entries : ") -- checks if a folder has been selected if dir ~= nil then -- Outputs the number of the directory entries ui.info("The choosen folder contains "..#dir.." entries") end