Document:MakeFolder Synchronous

Create a child folder inside the selected folder and return its handle. Use it to organize exports beneath a folder the user selected. The returned handle can be listed or used to create another level of folders.

Syntax
Luau
Document:MakeFolder(name: string) -> Document

Parameters

Call this method with a Document receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.

Function parameters
ParameterTypeDescription
namestringName of the child folder to create.

Returns

Document

A Document handle for the child folder. Calling this on a file raises an error.

Usage notes

Document is a handle returned by a file dialog or a folder method. Call its methods with a colon, for example document:Read(). After Delete succeeds, that handle is invalid and further method calls raise an error.

Example

Example
Luau
local folder = openfolderdialog()
if folder then
    local exports = folder:MakeFolder("Example exports")
    print("Export folder:", exports:GetName())
end
Kawaii documentation