On Wednesday, Sep 10, 2003, at 01:24 Europe/Brussels, Wouter wrote:
Hi,
Last post, too much midnight oil again
Big mistake, pasted a intermediary script. Terribly sorry.
Hope I got it right now.
Good night,
WA
on mouseUprepeat for each line x in it
put empty into field "result"
answer folder "Pick a folder you want to walk:"
if it is empty then exit mouseUp
if last char of it <> "/" then put "/" after it
put walkDir(it) into field "result"
end mouseUp
-- This recursive function expects a folder path.
-- It returns a file list for that folder and for each
-- sub-folder it contains (pre-order search)
-- Invisible files are excluded.
function walkDir dirPath
#### to have something to read while waiting
put dirPath
-- add 1 to isDepth
-- if isDepth > limitDepth then
-- put isDepth into limitDepth
-- put limitDepth
-- end if
put empty into tList
set defaultFolder to dirPath
-- Dar's discovery. Check permissions were ok
get the Result
if it is not empty then
-- subtract 1 from isDepth
return empty
end if
put the long files into fList
### instead of the if statement in the repeat loop
filter fList with "[!.]*"
repeat for each line fLine in fList
put dirPath & item 1 of fLine & comma & last item of fLine & return after tList
end repeat
#### change to eliminate the aliases
get shell("ls -F")
filter it with "*[/]"
#### shell() returns í for ƒ used in some cases to
#### designate a folder
replace "í" with "ƒ" in it -- added
set the itemDel to "/"
#### to eliminate the apps -- changed
#### comment out if not needed
if x = "Contents/" then
set the directory to dirpath & x
put the folders into a
if "Resources" is in a and "MacOS" is in a then
put char 1 to -2 of dirPath & return after tList
next repeat
end if
end if
put walkDir(dirPath & x) after tList
end repeat
-- subtract 1 from isDepth
return tList
end walkDir
