Hi, I'm trying to get a script working I found online that adds regions to the events on the timeline but I keep getting the msg missing pop-up, to be honest I haven't got a clue how to fix this. Can someone help pls.
(This is that second one 'I come from the future' in that link)
AddRegionsToEvents.js
import System;
import System.IO;
import System.Windows.Forms;
import Sony.Vegas;
var evnt : TrackEvent;
var myRegion : Region;
try {
//Find the selected event
var track = FindSelectedTrack();
if (null == track)
throw "no selected track";
var eventEnum = new Enumerator(track.Events);
while (!eventEnum.atEnd()) {
evnt = TrackEvent(eventEnum.item());
myRegion = new Region(evnt.Start,evnt.Length,evnt.ActiveTake.Name); 
Vegas.Project.Regions.Add(myRegion);
eventEnum.moveNext();
}
} catch (e) {
MessageBox.Show(e);
}
function FindSelectedTrack() : Track {
var trackEnum = new Enumerator(Vegas.Project.Tracks);
while (!trackEnum.atEnd()) {
var track : Track = Track(trackEnum.item());
if (track.Selected) {
return track;
}
trackEnum.moveNext();
}
return null;
}