Sound Forge Pro scripting uses the Microsoft .NET framework
for scripting. You can write scripts in JScript, Visual Basic .NET, or C#.
From the View menu, choose
Script Editor
if the Script Editor window isn't already visible.
Create a new script template:
Click the next to the New
Script Template button .
Choose the type of script you want to create.
Click the New
Script Template button .
A new script is displayed in the Script Editor window with everything you
need to get started.
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:
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
Click the Compile
Script button to compile and test your script. Any errors are displayed
at the bottom of the window.
Click the Save
button 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 Pro software are fully commented to help you find and edit the parameters
you need.
From the View menu, choose
Script Editor
if the Script Editor window isn't already visible.
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.
You cannot edit scripts that have been compiled
as DLLs.
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: //.
Click the Compile
Script button to compile and test your edited script. Any errors
are displayed at the bottom of the window.
Click the Save
button to replace the script you edited, or click the Save
As button if you want to save the edited script with a different
name or in a different location.