The contents in this page are fragmentary. Consult other sources if you want to learn Praat Scripting from a scratch*1.
echo Hello world
# Hello word script in Praat echo Hello world ; write to the Info window ## NOTE: An error occurs if ";" is replaced with "#"
echo Hello world
clearinfo ; clears the Info window printline Hello world
clearinfo print Hello world'newline$'
str$ = "foo" num = 3 ### statements below causes an error. ### #Str$ = "foo" ; it begins with Upper case. #Num = 3 #str = "foo" ; it lacks $, though it has a string.
str$[1] = "foo" str$[2] = "bar" str$[3] = "hoge" str$[4] = "piyo" num[1] = 3 num[2] = 34 num[3] = 22 num[4] = 98 ### statements below causes an error. ### #str[1] = "foo" ; it lacks $, though it has a string. #Num[4] = 98 ; it begins with Upper case.
fruit$ = "apple(s)" count = 3 echo I bought 'count' 'fruit$'.
fruit$ = "apple(s)" count = 3 echo "I bought" 'count' 'fruit$' "."
num = 3 str$ = "hoge" clearinfo if num = 3 printline 'num' endif if str$ = "hoge" printline 'str$' endif
str1$ = "abc" str2$ = "def" str3$ = "c" str4$ = str1$ + str2$ str5$ = str1$ - str3$ clearinfo printline 'str4$' printline 'str5$'
abcdef ab
n = 10 clearinfo while n >= 1 printline 'n' n = n-1 endwhile
clearinfo max = 10 for i to max if i = 5 i = max+1 ; escape from the loop else printline 'i' endif endfor
str$ = "abcdefg" len = length(str$) clearinfo for i from 1 to len hop$ = mid$(str$,i,1) printline 'i''tab$''hop$' endfor
# Windows system dir > hoge.txt && start notepad.exe hoge.txt