File dialogs
Let the user choose files or folders through the system picker. Dialogs return document handles for reading, writing, and browsing the selection, or nil when canceled.
Functions
Document:AppendAdd bytes after a selected file's existing contents. This suits a log that lives outside the workspace.
Document:DeleteDelete the selected document at its storage location. It also invalidates this handle, so discard the handle after a successful call.
Document:GetNameRead the display name of a selected file or folder. Show it in a confirmation or import list; keep the Document handle for actual file work.
Document:IsFileCheck whether a Document points to a file before reading its contents. This matters when you obtained handles by listing a folder.
Document:IsFolderCheck whether a Document points to a directory before asking for its children or creating a subfolder.
Document:ListGet Document handles for the contents of a selected folder. Choose recursive listing when you need descendants beyond its direct children.
Document:MakeFolderCreate a child directory inside the selected folder and keep the returned handle for the new location. It is useful for grouping a set of exports.
Document:ReadRead all bytes from a file chosen through a system dialog. Decode the resulting string yourself if the file contains JSON or another structured format.
Document:WriteReplace the entire contents of a selected file. This is appropriate when the user has approved updating an export in place.
openfiledialogLet the user choose one file through Android's picker. This is the right entry point for importing a document outside Kawaii's workspace.
openfilesdialogAsk the user to select several files at once. Each selected file comes back as its own Document handle for a batch import.
openfolderdialogAsk the user for a folder, then browse or add children through the returned handle. Use it when the import or export location should be their choice.
savefiledialogGive the user a save picker and write the supplied bytes at their chosen location. Prepare the complete export before opening the dialog.