Does anyone know any details about a file that's ...
1. Invisible
2. Named "Icon"
3. Kind is either 'Finder.app Document' or 'Unix Executable File'.
Your comments were helpful and I had intended to immediately chase down a bug in my script that caused an error when it encountered these Icon files, but my Mac mini decided to have problems at that time. A week and a new logic board later I have found the cause of my problem.
My script was getting a list of files in a folder using ...
set AppleScript's text item delimiters to {return}
do shell script "ls -tr " & (quoted form of (POSIX path of sourceFolder))
set msgList to (text items of the result) as list
If the folder contained an invisible file named "Icon" & return, then the name "Icon" appeared in msgList. There is no such file, so I got an error later in the script. I had originally obtained msgList via the Finder, but replaced this code with the code above when the Finder paused way too long while returning the list of items.
Fixing the problem with the "Icon" file required that I return to using the Finder.
Now I'm telling the Finder to ...
set msgList to (reverse of (sort items of sourceFolder by modification date))
repeat with i from 1 to (count items of msgList)
set item i of msgList to (item i of msgList) as alias
end repeat
It seems to be working without the long pause and, of course, it doesn't see the invisible icon file.
I ought to be able to shorten the code above to ...
set msgList to (reverse of (sort items of sourceFolder by modification date)) as alias list
but the Finder seems not to understand alias list despite its dictionary.