Scripting 6.7. Sending a message to another program

To send messages to running programs that use the Praat shell, use sendpraat (see Scripting 8. Controlling Praat from another program).

To send a message to another running program that listens to a socket, you can use the sendsocket directive. This works on Linux and Windows only.

Example

Suppose we are in the Praat-shell program Praat, which is a system for doing phonetics by computer. From this program, we can send a message to the non-Praat-shell program MovieEdit, which does know how to display a sound file:

Save as file: “hallo.wav”
sendsocket fonsg19.hum.uva.nl:6667 display hallo.wav

In this example, fonsg19.hum.uva.nl is the computer on which MovieEdit is running; you can specify any valid Internet address instead, as long as that computer allows you to send messages to it. If MovieEdit is running on the same computer as Praat, you can specify localhost instead of the full Internet address.

The number 6667 is the port number on which MovieEdit is listening. Other programs will use different port numbers.

Links to this page


© ppgb 20151020