ui.savedialog ([title] , [allow_mutiple_selection] , [filters])Displays a dialog box for the user to specify the drive, directory, and name of a file to save.
titleAn optional string that indicates the title of the dialog box (use the default system title if not specified).
allow_multiple_selectionAn optional boolean value that indicates if the dialog allow multiple files selection or not.
filtersAn optional string that indicates filters. A filter is used to display only files with a specified pattern. If omitted, the dialog shows all files.
A filter is composed of a
- A filter named "All files (*.*)" that correspond to the search pattern "*.*"
- A filter named "Text files (*.txt)" that correspond to the search pattern "*.txt"
Return valueThis function returns the selected file(s) as File object(s) or nil if no files have been choosen.
local ui = require "ui" -- open a dialog to choose a file to be saved local file = ui.savedialog("Save current date to...") -- checks if a file has been selected if file ~= nil then -- open the file and write the current date & time to it file:open("write"):write(sys.Datetime()) end