As a rule in unix world, all files and directories with names starting with dot are hidden.
HOWEVER, macOS also supports hidden flags on filesystem level. I don't think PB knows about it, but you can easily use NSURL to check. It will return hidden flag for both files and folders starting with . along with files and folders hidden on filesystem level (such as ~/Library).
Code:
If ExamineDirectory(0,GetEnvironmentVariable("HOME"),"*.*")
While NextDirectoryEntry(0)
EntryName$ = DirectoryEntryName(0)
If DirectoryEntryName(0) = "." Or DirectoryEntryName(0) = ".."
Continue
EndIf
If DirectoryEntryType(0) = #PB_DirectoryEntry_File
Type$ = "[File] "
Size$ = " (Size: " + DirectoryEntrySize(0) + ")"
Else
Type$ = "[Directory] "
Size$ = "" ; A directory doesn't have a size
EndIf
path$ = GetEnvironmentVariable("HOME") + "/" + DirectoryEntryName(0)
NSURL = CocoaMessage(0,0,"NSURL fileURLWithPath:$",@path$)
CocoaMessage(0,NSURL,"getResourceValue:",@isHidden,"forKey:$",@"NSURLIsHiddenKey","error:",0)
If CocoaMessage(0,isHidden,"boolValue")
Debug Type$ + "[HIDDEN] " + DirectoryEntryName(0) + Size$
Else
Debug Type$ + DirectoryEntryName(0) + Size$
EndIf
Wend
FinishDirectory(0)
EndIf