I have a praat script that creates text grids, zooms in to a specific time, and then pauses to allow me to annotate the text grid. However, there are multiple instances in each sound file that need annotation. When I save the text grid, it only saves the last annotation, and not all of the annotations. How do I get praat to save all annotations in each text grid? Here is my script:
@instance: "s0101b", 23.295323, "file path"
@instance: "s0101b", 40.343423, "file path"
@instance: "s0101c", 80.295323, "file path"
@instance: "s0101c", 90.343423, "file path"
procedure instance: .file_name$, start_time, .dir_name$
# create a list of wav files
strings = Create Strings as file list: "list", .dir_name$ + "/*.wav"
numberOfFiles = Get number of strings
for ifile to numberOfFiles
selectObject: strings
fileName$ = Get string: ifile
Read from file: .dir_name$ + "/" + fileName$
endfor
selectObject:strings
Remove
windowstart = start_time - 0.05
windowend = start_time + 0.50
selectObject: "Sound '.file_name$'"
To TextGrid: "annotation", "bell"
select TextGrid '.file_name$'
plus Sound '.file_name$'
View & Edit
editor TextGrid '.file_name$'
Select... 'windowstart' 'windowend'
Zoom to selection
pause Add boundaries, and record
Close
endeditor
select TextGrid '.file_name$'
Write to text file... file path/'.file_name$'_editedtext.TextGrid
endproc
writeInfoLine: "Finished!"
select all
Remove