System information
1. Create a copy of the script (.vb or .js) file you want to edit, assigning a descriptive name to the copy.
2. Open the new copy of the script in your text editor.
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: //.
For example, the AddEffectToAllMedia.js script includes the following lines:
// This is the full name of the effect plug-in you want to add.
var plugInName = "Sony Timecode";
// This is the name of the preset you want. Set this to null if you
// want the default preset.
var presetName = "SMPTE Drop (29.97 fps)";
The default script applies the Sony Timecode plug-in to all video media in your project using the
SMPTE Drop (29.97 fps)preset. If you wanted to apply the Broadcast Colors plug-in's Extremely
Conservative - 7.5 Setup preset to all audio media, you could edit the script as follows (changes
appear in red):
// This is the full name of the effect plug-in you want to add.
var plugInName = "Sony Broadcast Colors";
// This is the name of the preset you want. Set this to null if you// want the default preset.
var presetName = "Extremely Conservative - 7.5 Setup
The plugInName variable should use the plug-in name that is displayed in the Plug-In Chooser. The
presetName variable should use the preset name that is displayed in the Preset box in the FX
window.
3. Save the script.
Creating custom button images for scripts
If you want to display custom icons for scripts in the Scripting menu and toolbars, you can add .png files to
your Script Menu folder.
1. Create a 32-bit PNG file with the icon you want to use. Icons must be 16x16 pixels, and
transparency is supported.
2. Save the PNG file in your Script Menu folder (typically C:\Program Files\Sony\Vegas Pro\Script
Menu) using the same name as the script the icon should represent.
For example, to assign a custom icon to the HelloWorld.js script, the icon should be saved as
HelloWorld.js.png.
3. Customize the toolbar as needed, and the custom icons will be displayed in the Scripting menu (and
in any toolbars that include the script) toolbar the next time you start the application.
USING SCRIPTING563