directory walking sorted; file listing modification

Bob Hartley bob at armbase.com
Thu Dec 4 04:08:38 EST 2003


Hi all

Thanks to Klaus for showing me where to put the line of code and Sarah for 
suggesting
>filter gHierList with "raw*.pic"


I slightly modified this to filter gHierList with "*raw*.pic" and the 
button puts all the files into a list.

so my final code looks like

global gHierList
on mouseUp
   put empty into gHierList
   put empty into field 1
   answer folder "Pick a folder you want to walk:"
   if it is empty then exit mouseUp
   set lockCursor to true
   set cursor to watch
   directoryWalk it
   filter gHierlist with "*raw*.pic"
   sort gHierList
   put gHierList into field 1
   put number of lines of fld 1
   set lockCursor to false
end mouseUp

on directoryWalk whatFolder
   set the defaultFolder to whatFolder
   put the files into temp
   repeat for each line x in temp
     put whatFolder & "/" & x & return after gHierList
   end repeat
   put the folders into tDirList
   repeat with x =  2 to the number of lines of tDirList
     directoryWalk (whatFolder & "/" & (line x of tDirList))
   end repeat
end directoryWalk


This works great. You can see the screenshot at:-
http://www.armbase.com/screenshots.html

All I need to do now is create a script to transfer the files in the list 
to a chosen directory.

But that is later.

Thanks again:
PS If anyone wants any pocketPC database apps made then I can do this for 
you free.


Cheers
Bob







More information about the use-livecode mailing list