Using the Log Window When Scripting

It is a good idea to begin scripting by writing some simple scripts that output some text to the Log window.

The goal of the following example is to output a simple text message to the Log window.

Procedure

  1. Select Tool Windows > Log.
  2. Copy and paste the following script into the Script Editor.

    //output the number of samples in the active wave as text in the log window.

    logWindow.printInfo("This file has " + activeWave.size() + " samples");

    Note

    Any lines of a script that begin with two forward slashes // are comments, and are ignored when the script is executed.

  3. Execute the script.

Result

In the Log window, the number of samples used in the active file is displayed.