form: "Annotate or review existing annovations" word: "File Location", "D:\experimentFiles\cs_audio\" positive: "start", "1" integer: "stop_(0_=_all_files)", "0" endform homeDir$ = file_Location$ @getDirSep if (right$(homeDir$,1) <> dirSep$ ) homeDir$ = homeDir$ + dirSep$ endif Create Strings as file list: "fileList", homeDir$ + "*.wav" n = Get number of strings if stop < 1 stop = n endif for i from start to stop selectObject: "Strings fileList" a$ = Get string: i currentWav = Read from file: homeDir$ + a$ b$ = selected$("Sound",1) textGrid$ = b$ + ".textGrid" textGridFile$ = homeDir$ + textGrid$ if fileReadable(textGridFile$) currentTg = Read from file: textGridFile$ plusObject: currentWav Edit pause check this already annotated file else #adjust this line to the structure the textgrids needs for your project #here, we just need one interval tier currentTg = To TextGrid: "target", "" plusObject: currentWav Edit pause annotate this file endif selectObject: currentTg Write to text file: homeDir$ + b$ + ".textGrid" if i > start appendInfoLine: "iteration " + fixed$(i,0) else writeInfoLine: "first iteration" endif appendInfoLine: "last analyzed textGrid was: " + textGridFile$ select all minusObject: "Strings fileList" Remove endfor procedure getDirSep if windows == 0 dirSep$ = "/" else dirSep$ = "\" endif endproc