I've found a bug (10.4.11) which is probably still in Leopard since I
looked at the Leopard bug fix technote and it's not mentioned. I've
reported the bug to Apple.
If the target folder of the "list folder" command has a name longer
than 32 characters you get a "bad filename" error. I can't use the
Finder to get the info because the very reason I'm needing the
command for is to force the lazy Finder to update the contents of the
folder!
I came up with the following workaround, with finderPath as the
colon-delimited path of the target as text:
set oldDelims to Applscript's text item delimiiters
set Applscript's text item delimiiters to return
set folderContents to (every item of (do shell script "ls -1 " &
quoted form of (POSIX path of finderPath)))
set set Applscript's text item delimiiters to oldDelims
--force the Finder to update
tell application "Finder"
repeat with thisItem in folderContents
update alias (finderPath & thisItem)
end repeat
end tell
--Emmett