I am trying to create a script to add markers to a project based on timecodes which exist in a text file (each line of the text file is hh:mm:ss.ff0, ff0=frame).
Looked for an existing script to read the text file and create markers, but couldn't find one. I've never created a script, but thought I'd modify an existing one & give it a try.
I found the following (w/ deference to who ever created it - it's not labelled). Any suggestions for how I'd modify it to read from a text file and loop through the file creating markers for each entry in the file?
TIA for any help....
/**
* This script will add markers at the specified interval
**/
import System;
import System.IO;
import System.Windows.Forms;
import Sony.Vegas;
//Change this value to be the desired interval
//Format: hh:mm:ss:ff (hours:minutes:seconds:frames)
var Interval = "00:05:00:00";
try {
var myMarker : Marker;
var IncTime : Timecode = new Timecode(Interval);
var CurrTime : Timecode = IncTime;
var EndTime : Timecode = Vegas.Project.Length;
while (CurrTime < EndTime) {
//Put a marker at the interval point
myMarker = new Marker(CurrTime);
Vegas.Project.Markers.Add(myMarker);
CurrTime = CurrTime + IncTime;
}
} catch (e) {
MessageBox.Show(e);
}
Looked for an existing script to read the text file and create markers, but couldn't find one. I've never created a script, but thought I'd modify an existing one & give it a try.
I found the following (w/ deference to who ever created it - it's not labelled). Any suggestions for how I'd modify it to read from a text file and loop through the file creating markers for each entry in the file?
TIA for any help....
/**
* This script will add markers at the specified interval
**/
import System;
import System.IO;
import System.Windows.Forms;
import Sony.Vegas;
//Change this value to be the desired interval
//Format: hh:mm:ss:ff (hours:minutes:seconds:frames)
var Interval = "00:05:00:00";
try {
var myMarker : Marker;
var IncTime : Timecode = new Timecode(Interval);
var CurrTime : Timecode = IncTime;
var EndTime : Timecode = Vegas.Project.Length;
while (CurrTime < EndTime) {
//Put a marker at the interval point
myMarker = new Marker(CurrTime);
Vegas.Project.Markers.Add(myMarker);
CurrTime = CurrTime + IncTime;
}
} catch (e) {
MessageBox.Show(e);
}