##################################################################################### # Number symbol inserter in interval tier : Written by Kyuchul Yoon ( kyoon@ling.osu.edu ) # Inserts a "NUMBER" symbol to the interval you click # # Directory structure for this script should be like the following # root\ : Script should be here # 302000.txt\TextGridDone # 302002.txt\TextGridDone # 302004.txt\TextGridDone # .... # The filename of the output files are .Num ##################################################################################### form Select files comment Inserts a NUMBER symbol into the interval you click word subFolderToProcess 302002.txt\TextGridDone word fileExtOfDoneFiles TextGrid.done.period word symbolToInsert NUMBER word outFileExt num endform # Get the list of filenames of TextGrid.done files Create Strings as file list... fileList 'subFolderToProcess$'\*.'fileExtOfDoneFiles$' numFiles = Get number of strings # Loop throught each file for iFile to numFiles select Strings fileList # Get the name for a TextGrid.done file doneFile$ = Get string... iFile Read from file... 'subFolderToProcess$'\'doneFile$' Rename... grid Edit editor TextGrid grid pause Click the interval to insert a 'symbolToInsert$' symbol ( to finish) eojeolLabel$ = Get label of interval while (eojeolLabel$ <> "") startPointInterval = Get starting point of interval endeditor select TextGrid grid intervalNum = Get interval at time... 1 startPointInterval Set interval text... 1 intervalNum 'symbolToInsert$' pause Click the interval to insert a 'symbolToInsert$' symbol ( to finish) select TextGrid grid editor TextGrid grid eojeolLabel$ = Get label of interval endwhile endeditor pause File to be updated and written to 'doneFile$'.'outFileExt$' Write to text file... 'subFolderToProcess$'\'doneFile$'.'outFileExt$' Remove endfor select Strings fileList Remove #### END OF SCRIPT ####