I found my problem. It was actually how I read the flag that shows the hidden state of a file or folder. Here’s the way it works now:
on refreshTableViewWithURL_(theURL)
tell current application's NSMutableArray to set destinationFolderContentArray to arrayWithCapacity_(1)
set theDestinationFolderContents to theFileManager's contentsOfDirectoryAtPath_error_(theURL's |path|(), missing value)
repeat with currentItem in theDestinationFolderContents
tell current application's |NSURL| to set sourceItemURL to fileURLWithPathComponents_({theURL's |path|(), currentItem})
if ((sourceItemURL's resourceValuesForKeys_error_({current application's NSURLIsHiddenKey}, missing value))'s objectForKey_(current application's NSURLIsHiddenKey)) as boolean is false then
set fileAttributesFromURL to sourceItemURL's resourceValuesForKeys_error_({¬
current application's NSURLNameKey, ¬
current application's NSURLLocalizedNameKey, ¬
current application's NSURLIsHiddenKey, ¬
current application's NSURLIsRegularFileKey, ¬
current application's NSURLIsDirectoryKey, ¬
current application's NSURLIsVolumeKey, ¬
current application's NSURLIsPackageKey, ¬
current application's NSURLIsSymbolicLinkKey, ¬
current application's NSURLCreationDateKey, ¬
current application's NSURLContentModificationDateKey, ¬
current application's NSURLTypeIdentifierKey, ¬
current application's NSURLLocalizedTypeDescriptionKey, ¬
current application's NSURLEffectiveIconKey, ¬
current application's NSURLFileSizeKey}, missing value)
set {itemName, ¬
itemLocalizedName, ¬
itemIsHidden, ¬
itemIsRegularFile, ¬
itemIsDirectory, ¬
itemIsVolume, ¬
itemIsPackage, ¬
itemIsSymbolicLink, ¬
itemCreationDate, ¬
itemModificationDate, ¬
itemTypeIdent, ¬
itemLocalizedDescription, ¬
itemIcon, ¬
itemFileSize} ¬
to {¬
(fileAttributesFromURL's valueForKey_(current application's NSURLNameKey)), ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLLocalizedNameKey)), ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLIsHiddenKey)) as boolean, ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLIsRegularFileKey)) as boolean, ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLIsDirectoryKey)) as boolean, ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLIsVolumeKey)) as boolean, ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLIsPackageKey)) as boolean, ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLIsSymbolicLinkKey)) as boolean, ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLCreationDateKey)), ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLContentModificationDateKey)), ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLTypeIdentifierKey)) as string, ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLLocalizedTypeDescriptionKey)) as string, ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLEffectiveIconKey)), ¬
(fileAttributesFromURL's valueForKey_(current application's NSURLFileSizeKey))}
destinationFolderContentArray's addObject_({itemTitle:itemLocalizedName, itemURL:sourceItemURL, itemIcon:itemIcon, isRegularFileKey:itemIsRegularFile, itemIsDirectory:itemIsDirectory, isVolumeKey:itemIsVolume, isPackageKey:itemIsPackage, itemIsSymbolicLink:itemIsSymbolicLink})
end
end
end refreshTableViewWithURL_
Model: MacBookPro8,2
Browser: Safari 534.51.22
Operating System: Mac OS X (10.7)