#Annotates sound files to textGrids. #@author: Stephanie Packard # University of Iowa # 01/18/07 #IMPORTANT NOTES: #This script searches for and opens sound files in the current directory. #Additional sound file types can be implemented by adding buttons to the form. #This script saves the textGrid file with the same name as its matching sound file. form Script preferences choice FileType: 1 button .AIFF button .wav endform searchType$ = "*" + "'fileType$'" Create Strings as file list... soundList 'searchType$' numSounds = Get number of strings if numSounds = 0 echo "There are no 'fileType$' sound files in the current directory." exit endif for ifile to numSounds select Strings soundList soundName$ = Get string... ifile Open long sound file... 'soundName$' label$ = left$("'soundName$'", length("'soundName$'")-length("'fileType$'")) label$ = "'label$'" + ".TextGrid" To TextGrid... "Mary John bell" bell Write to text file... 'label$' endfor select all Remove