Sound Forge scripting uses the Microsoft .NET framework for scripting. You can write scripts in JScript, Visual Basic .NET, or C#.

  1. From the View menu, choose Script Editor if the Script Editor window isn’t already visible.

  2. Create a new script template:

a. Click the Sound Forge Pro b downarrow2 Editing or Creating Scripts next to the New Script Template button Sound Forge Pro b scripttemplate Editing or Creating Scripts.

b. Choose the type of script you want to create.

c. Click the New Script Template button Sound Forge Pro b scripttemplate Editing or Creating Scripts.

A new script is displayed in the Script Editor window with everything you need to get started.

  1. Replace the  /*begin here*/ text with your script.

    In the following sample JScript script, the text in green was added to the script template. When run, this script would add information to the Summary window for the active data window. Red text represents information that you would want to customize:

import System;
import System.Windows.Forms;
import SoundForge;

public class EntryPoint {
public function Begin(app : IScriptableApp) {

var file = app.CurrentFile;
if (null != file)
{

var sumy = file.Summary;
for (var fcc in sumy)
{
DPF(“fcc=” + fcc + ” ‘” + sumy.Item(fcc) + “‘”);
}

 //MODIFY HERE – type your own information in the area below
sumy.Title = “Title“;
sumy.Subject = “Subject“;
sumy.Engineer = “Engineer“;
sumy.Copyright = “Copyright“;
sumy.Comments = “Comments“;
sumy.CreationDate = “2005-01-05“;
sumy.Genre = “Genre“;
sumy.TrackNo = “TrackNo“;
sumy.Album = “Album“;
sumy.Artist = “Artist“;
}

}

public function FromSoundForge(app : IScriptableApp) {
ForgeApp = app;
app.SetStatusText(String.Format(“Script ‘{0}’ is running.”, Script.Name));
Begin(app);
app.SetStatusText(String.Format(“Script ‘{0}’ is done.”, Script.Name));
}
public var ForgeApp : IScriptableApp = null;
public function DPF(sz) { ForgeApp.OutputText(sz);}
public function DPF(sz,o) { ForgeApp.OutputText(System.String.Format(sz,o)); }
public function DPF(sz,o,o2) { ForgeApp.OutputText(System.String.Format(sz,o,o2)); }

public function DPF(sz,o,o2,o3) { ForgeApp.OutputText(System.String.Format(sz,o,o2,o3)); }

} // class EntryPoint

  1. Click the Compile Script button Sound Forge Pro b compilescript Editing or Creating Scripts to compile and test your script. Any errors are displayed at the bottom of the window.

  2. Click the Save button Sound Forge Pro b save Editing or Creating Scripts to choose the file name and location you want to use to save the script.

All you need to edit a script is the Script Editor window (and, or course,  a working knowledge of JScript, Visual Basic .NET, or C# scripting). The scripts that are included with Sound Forge software are fully commented to help you find and edit the parameters you need.

  1. From the View menu, choose Script Editor if the Script Editor window isn’t already visible.

  2. Click the Open button in the Script Editor window, choose the script you want to edit, and then click Open.

    The contents of the script are displayed in the Script Editor window.

Sound Forge Pro note Editing or Creating ScriptsYou cannot edit scripts that have been compiled as DLLs.

  1. Edit the script as needed. The comments in the script will help you find the parameters you need to edit.

    Comments are indicated with double forward slashes: //.

  1. Click the Compile Script button Sound Forge Pro b compilescript Editing or Creating Scripts to compile and test your edited script. Any errors are displayed at the bottom of the window.

  2. Click the Save button Sound Forge Pro b save Editing or Creating Scripts to replace the script you edited, or click the Save As button Sound Forge Pro b saveas Editing or Creating Scripts if you want to save the edited script with a different name or in a different location.

Editing or Creating Scripts

Sound Forge Pro b showscripteditor Editing or Creating Scripts

Ctrl+Alt+2

View Menu

Use the Script Editor window to open, create, edit, or run scripts.

You can find the most recent scripting API (application programming interface) and sample scripts on our Web site. For more information about scripting, please check out the scripting forum.


What do you want to do?

Sound Forge Pro arrowdn Editing or Creating Scripts Create a script

Sound Forge Pro arrowdn Editing or Creating Scripts Edit an existing script

Sound Forge Pro btnshowall Editing or Creating Scripts

Editing or Creating Scripts