Document: IsFile Synchronous
Check whether this selected document represents a file. Use it when browsing a selected folder so your script only attempts reads on files.
Luau
Document:IsFile() -> 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 file and false for a folder.
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:IsFile() then
print("file:", child:GetName())
end
end
end