Document: IsFolder Synchronous
Check whether this selected document represents a folder. Use it when browsing a selected folder so your script only attempts directory operations on folders.
Luau
Document:IsFolder() -> booleanParameters
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
booleantrue for a folder and false for a file.
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
Luau
local folder = openfolderdialog()
if folder then
for _, child in ipairs(folder:List()) do
if child:IsFolder() then
print("folder:", child:GetName())
end
end
end