Same handler returns different folder contents
Same handler returns different folder contents
- Subject: Same handler returns different folder contents
- From: Phil Burk <email@hidden>
- Date: Mon, 05 Mar 2001 12:47:52 -0500
Greetings to the list. I'm sure you're tiring of the same old questions
over and over and over...
I have a handler that is passed a path as text and subsequently writes the
contents of that path to a text file item by item. I'm scanning three
directories located on three separate volumes and checking for differences.
I'm puzzled as to why the handler returns the proper (alphabetical) order on
the SECOND run but runs in reverse alphabetical order with the second level
of folders discovered in the FIRST and THIRD runs. Huh? I've duplicated
the handler and called each separately for each itemization but I still get
the same odd results...
Handler to follow. Any suggestions more than welcome!
Encoded with applescriptEndec:
-- Encoded with AppleScript Endec 1.0.3
on logDest1Contents(pathToFolder)
set savedTextItemDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to {return}
set theListRef to a reference to list folder pathToFolder without
invisibles
repeat with nextItem in theListRef
set itemPath to pathToFolder & nextItem
set itemInfo to info for alias itemPath
if folder of itemInfo then
open for access file LogFileDest1 with write permission
write (return & itemPath) to LogFileDest1 starting at eof
close access LogFileDest1
logDest1Contents(itemPath & ":")
else
open for access file LogFileDest1 with write permission
write (return & itemPath) to LogFileDest1 starting at eof
close access LogFileDest1
set the fileList to fileList & itemPath
end if
end repeat
return fileList
set AppleScript's text item delimiters to savedTextItemDelimiters
end logDest1Contents
----------------------------------------------------------------------------
Phil Burk
DesktopMedia, Inc.
email@hidden
"If a man has no vices, he's in great danger of making vices about his
virtues, and there's a spectacle."
- Thornton Wilder, "The Matchmaker" (1955)