At 1:03 PM -0500 28/11/1999, Andrew Griffin wrote:
>I've been trying to figure out how to look into a folder and put a list
>of all the files into a field. Basically all I need is the file names
>for the files. I already have the path of the stack and the name of the
>folder, which is "Music", that I need to search in. So, what I need is
>a script that will search through the folder "Music" and find all the
>files with the ".mid" extension. Once it has done that it will put the
>name of each file with that extension into a scrolling field titled
>"List". Is there a way to do this? If so, how? Any help would be
>greatly appreciated! Thanks!
Hi Andrew
The files() function is what you need. It returns a list of the files
in the current directory.
There is also a "filter" command you can use to filter the list of
files. So something like:
set the directory to "/somePath/music"
put the files into tFileList
filter tFileList with "*.mid"
sort tFileList -- put in alphabetical order
put tFileList into field "list"
Cheers
Dave Cragg