Scripting

This is one of the tutorials of the Praat program. It assumes you are familiar with the Intro.

A script is a text that consists of menu commands and action commands. If you run the script (perhaps from a ScriptEditor), the commands are executed as if you clicked on them.

You can read this tutorial sequentially with the help of the "< 1" and "1 >" buttons.

Scripting 1. My first script (how to create, how to run)
Scripting 2. Arguments to commands (numeric, check, radio, text, file)
Scripting 3. Layout (white space, comments, continuation lines)
Scripting 4. Object selection (selecting and querying)
Scripting 5. Language elements
    Scripting 5.1. Variables (numeric, string, substitution)
    Scripting 5.2. Formulas (numeric, string)
    Scripting 5.3. Jumps (if, then, elsif, else, endif)
    Scripting 5.4. Loops (for/endfor, while/endwhile, repeat/until)
    Scripting 5.5. Procedures (call, procedure)
    Scripting 5.6. Arrays
    Scripting 5.7. Including other scripts
    Scripting 5.8. Quitting (exit)
Scripting 6. Communication outside the script
    Scripting 6.1. Arguments to the script (form/endform, execute)
    Scripting 6.2. Writing to the Info window (echo, print, printtab, printline)
    Scripting 6.3. Query commands (Get, Count)
    Scripting 6.4. Files (fileReadable, <, >, >>, filedelete, fileappend)
    Scripting 6.5. Calling system commands (system, environment$, stopwatch)
    Scripting 6.6. Controlling the user (pause)
    Scripting 6.7. Sending a message to another program (sendsocket)
    Scripting 6.8. Messages to the user (exit, assert, nowarn, nocheck)
    Scripting 6.9. Calling from the command line
Scripting 7. Scripting the editors
    Scripting 7.1. Scripting an editor from a shell script (editor/endeditor)
    Scripting 7.2. Scripting an editor from within
Scripting 8. Controlling Praat from another program
    Scripting 8.1. The sendpraat subroutine
    Scripting 8.2. The sendpraat program
    Scripting 8.3. The sendpraat directive

Also see the scripting examples.

Links to this page


© ppgb, December 8, 2008