Document:GetName Synchronous

Read 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.

Syntax
Luau
Document:GetName() -> string

Parameters

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

This function takes no arguments.

Returns

string

The display name as a string.

Usage notes

A Document is a handle to the user-selected location, not a workspace path. Call methods with a colon and keep the handle for later operations.

The name alone is not a workspace path. Deleted Document handles reject this method.

Example

Example
Luau
local document = openfiledialog()
if document then
    print("Selected:", document:GetName())
end
Kawaii documentation