Document: Append Synchronous
Add bytes after a selected file's existing contents. This suits a log that lives outside the workspace.
Luau
Document:Append(contents: string) -> ()Parameters
Call this method with a Document receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.
| Parameter | Type | Description |
|---|---|---|
contents | string | Text or binary bytes to add. |
Returns
()No values.
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.
No newline is inserted automatically. Appending to a folder raises.
Example
Luau
local document = savefiledialog("Started\n", { suggestedName = "session.txt" })
if document then
document:Append("Finished\n")
print(document:Read())
end