Getting Directory Tree
got at mindspring.com
Wed Feb 2 13:23:27 CST 2005
> I'm at a loss. I've spent the last 3 hours trying to make a script
> that will look at 1 directory and provide a complete hierarchial list
> of all files within all folders and subfolders, and I can't make it
> Has anyone else attempted this, and been successful?
How about something like this?
function GetFolderContents pFolder
local tSaveDefaultFolder, tFolder, tFolders, tList
put the defaultFolder into tSaveDefaultFolder
set the defaultFolder to pFolder
get the folders
filter it without "."
filter it without ".."
put it into tFolders
local tFiles, tFile
get the files
put it into tFiles
put pFolder & return after tList
repeat for each line tFile in tFiles
put pFolder & "/" & tFile & return after tList
repeat for each line tFolder in tFolders
put GetFolderContents(tFolder) after tList
set the defaultFolder to tSaveDefaultFolder
More information about the use-livecode