# This script opens all sound files in the specified text file and associated TextGrids, # pauses for the user to check and possibly alter the TextGrid, # then saves the new TextGrid in the same directory if applicable. # Jevon Heath, 5/6/15 #Script adapted by Steven Ho # Create a list of all sound files in the directory. form Check Textgrids for .wav files listed in this file comment Name of directory: text directory /media/sf_xrmbdb comment Name of text file: text textfile listofwavs.txt endform Read Strings from raw text file... 'directory$'/'textfile$' fileList$ = selected$ ("Strings") n = Get number of strings history$ = "start" start = readFile (history$) # Open each sound file and its associated TextGrid so the TextGrid can be manipulated. # Once the user clicks "Continue", the TextGrid is saved and the next soundfile is opened. for i from start to n select Strings 'fileList$' soundfile$ = Get string... i Read from file... 'directory$'/'soundfile$' soundname$ = selected$ ("Sound") tgname$ = soundname$ Read from file... 'directory$'/'tgname$'.TextGrid plus Sound 'soundname$' do("View & Edit") beginPause("Any edits?") clicked = endPause("Continue", "Save and Continue", 1) select TextGrid 'tgname$' if clicked = 2 Save as text file... 'directory$'/'tgname$'.TextGrid endif plus Sound 'soundname$' Remove deleteFile: history$ writeFile: history$, i+1 endfor