I'm trying to get Edward Troxel's script working in Magix Vegas 13 Pro, build 543, but without any success.
The script is:-
/**
* This script will Fade the selected audio track up to the current cursor position
*
* Written By: Edward Troxel
* Modified: 04-21-2003
**/
import System;
import System.IO;
import System.Windows.Forms;
import Sony.Vegas;
try {
//Go through the list of Tracks
var trackEnum = new Enumerator(Vegas.Project.Tracks);
while (!trackEnum.atEnd()) {
var track : Track = Track(trackEnum.item());
//Go through the list of Events
var eventEnum = new Enumerator(track.Events);
while (!eventEnum.atEnd()) {
var evnt : TrackEvent = TrackEvent(eventEnum.item());
if (evnt.Selected) {
evnt.FadeIn.Length = new Timecode("00:00:01:00");
evnt.FadeOut.Length = new Timecode("00:00:01:00");
}
eventEnum.moveNext();
}
trackEnum.moveNext();
}
} catch (e) {
MessageBox.Show(e);
If I run it as a .js file, I get the following error:-
D:\Vegas\Scripts\FadeInOut1Second.js(42) : Expecting more source characters
and if I change the extension to .cs, I get these errors:-
D:\Vegas\Scripts\FadeInOut1Second.cs(9) : A namespace cannot directly contain members such as fields or methods
D:\Vegas\Scripts\FadeInOut1Second.cs(19) : Expected class, delegate, enum, interface, or struct
D:\Vegas\Scripts\FadeInOut1Second.cs(24) : Expected class, delegate, enum, interface, or struct
D:\Vegas\Scripts\FadeInOut1Second.cs(30) : Expected class, delegate, enum, interface, or struct
D:\Vegas\Scripts\FadeInOut1Second.cs(31) : Expected class, delegate, enum, interface, or struct
D:\Vegas\Scripts\FadeInOut1Second.cs(33) : Type or namespace definition, or end-of-file expected
And ideas how I can get it to work?
Thank you.