[[FrontPage]]

* A Quick Look at Praat Scripting [#ncd89e32]

The contents are fragmentary. Consult other sources if you want to learn Praat Scripting from a scratch.
The contents are fragmentary. Consult other sources if you want to learn Praat Scripting from a scratch((Highly recommanded: Ingmar Steiner (2006-2007) '''Automatic Speech Data Processing with Praat'''. Lecture Notes. (PDF file is available at www.coli.uni-saarland.de/~steiner/praat/lecturenotes.pdf.) )).
//PDF file is [[here>www.coli.uni-saarland.de/~steiner/praat/lecturenotes.pdf]]. 

- Comparative Operators
#contents

- ''elsif''
** Language Specification Worth Mentioning [#b3a53f90]

- comment
-- If you want to write a comment at the end of a statement, for example, you can use ";", instead of "#"
 str$ = "abcdefg"         ; string variable
 num = 3                  ; numeric variable
 echo 'str$''tab$''num'
 # An error occurs if ";" is replaced with "#"

//- No declaration is required to use a variable.

- variable types: numerics and strings
- array

- index numbers start at 1 (not 0).

- Comparison Operators
-- You can use "=", in addition to "=="
 num = 3
 str$ = "hoge"
 
 clearinfo
 if num = 3
     printline 'num'
 endif
 
 if str$ = "hoge"
     printline 'str$'
 endif

- ''elsif'' (neither ''elseif'' nor ''else if'')

- Regular expressions are available in many functions.

- ''form'' and ''endform''

- No double quotations are required in ''print'' (and ''printline'' and ''echo'')

- ''system''

- procedures (or subroutines/functions)

- decrement in ''for''-loop

- Consider the use of ''Table Object'' when you refer to the contents in text files.

- [[Scripting 3.1. Hello world>http://www.fon.hum.uva.nl/praat/manual/Scripting_3_1__Hello_world.html]] (official site)

** Functions of ScriptEditor [#m4b8a142]
- History
- Run a script

** Other ways to execute a script [#c753a9f4]

- sendpraat.exe
- praatcon.exe (in Windows)
-- scripts can be executed by using sendpraat.exe or praatcon.exe.
-- You may use option -a in praatcon.exe if you handle Unicode. (cf. [[Re: [praat-users] Bug in latest praatcon version (by Paul Boersma)>http://uk.groups.yahoo.com/group/praat-users/message/4950]]


Front page   New List of pages Search Recent changes   Help   RSS of recent changes