ui.dirdialog([title], [path])

Displays a Windows dialog for the user to choose a directory.

Notes

  • The dialog box only uses the current Windows system theme

Parameters

[title]

An optional string that provides a dialog title.

[path]

An optional Directory or string that indicates the folder selected when the dialog shows.

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.dirdialog("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