##############################################################################
# Modified by Mauricio Figueroa (www.mauriciofigueroa.cl) for teaching 
# purposes. The script has been modified to contain several fatal bugs as well 
# as other documentation and stylistic problems. This script should not be used
# for research purposes.
##############################################################################

# This script will open all the files in a given folder. All the files must be
# recognized by Praat (either sound files such as AIFF or WAV or Praat
# analysis files like TextGrid).
# This script is distributed under the GNU General Public License.
# Copyright 11.3.2002 Mietta Lennes

form Open all files in directory
sentence Directory ../files_to_open/
endform
Create Strings as file list... list 'directory$'*
numberOfFiles = Get number of strings
for ifile to numberOfFiles
filename$ = Get string... ifile
if right$ (filename$, 4) != ".wav"
Read from file... 'directory$''filename$'
endif
select Strings list
endfor
select Strings list
# Remove
