Hello All
I’m trying to add generic markers in a Montage workspace using the Scripting environment (which is great, thanks PG).
The below is a simplified example hacked together from the examples in the pdf manual, and extended a little from the ECMAscript guidleines.
The script works perfectly in an Audio workspace, but when executed in a Montage workspace fails at the line:
activeWave.setCursorPosition(nextCursorPosition * activeWave.sampleRate() );
with the error: Error at line [line Num]: ReferenceError: Can’t find variable: activeWave
Any help or suggestions most appreciated!
Regards
Tom
//////////////////////////////////////////////////
//clear the log window
logWindow.clear();
// Array of arrays of marker data (time, info)
var timeArr = new Array(
new Array( 0, “w”),
new Array( 0.5, “x”),
new Array( 1.0, “y”),
new Array( 1.25, “x” )
);
//loop through and add a markers
for (i = 1; i <= 4; i++) {
var data = timeArr.shift(); // bring forward next data array
var nextCursorPosition = data.shift(); //work out next cursor time
var info = data.shift(); // some info
var comment = nextCursorPosition + ", info: "+ info;
logWindow.printInfo(comment); // print to log window
// problem:
activeWave.setCursorPosition(nextCursorPosition * activeWave.sampleRate() );
activeWave.addMarker(generic, i, comment);
}
//////////////////////////////////////////////////