scripting problems with Vegas 7

rs170a wrote on 5/13/2007, 5:49 AM
Since I installed Vegas 7, I've been having problems running most of my existing scripts. Searches of this and the Scripting forum show that other users are having problems as well with no solution that I could find.
Any help is greatly appreciated.

As an example, here's one Exception report:

C:\Program Files\Sony\Vegas 7.0\Script Menu\ReduceInterlaceFlicker.js(19) : Variable 'Timecode' has not been declared
C:\Program Files\Sony\Vegas 7.0\Script Menu\ReduceInterlaceFlicker.js(20) : Variable 'Marker' has not been declared
C:\Program Files\Sony\Vegas 7.0\Script Menu\ReduceInterlaceFlicker.js(44) : Variable 'Track' has not been declared
C:\Program Files\Sony\Vegas 7.0\Script Menu\ReduceInterlaceFlicker.js(47) : Expression must be a compile time constant
C:\Program Files\Sony\Vegas 7.0\Script Menu\ReduceInterlaceFlicker.js(29) : Variable 'VideoEvent' has not been declared

Mike

edit: this is on a brand new machine with all the latest updates including Framework 2.0

Comments

Grazie wrote on 5/13/2007, 5:57 AM
Yup! Ditto here.
johnmeyer wrote on 5/13/2007, 10:29 AM
I have 7.0d installed and have no problems running scripts. However, the ReduceInterlaceFlicker script does throw error messages, and has for a long time. Try this version instead:



/**
* This script will turn on Reduce Interlace Flicker for all selected events on all selected tracks.
* 04/02/2003 jetdv
*
* Modified By: John Meyer
* 05/3/2005
**/

import System;
import System.IO;
import System.Windows.Forms;
import Sony.Vegas;


try {
var counter = 0;
var trackEnum = new Enumerator(Vegas.Project.Tracks);
while (!trackEnum.atEnd()) {
var track : Track = Track(trackEnum.item());
if (track.Selected && track.IsVideo() ) {
var eventEnum = new Enumerator(track.Events);
while (!eventEnum.atEnd()) {
var evnt : VideoEvent = VideoEvent(eventEnum.item());
if (evnt.Selected) {
counter = counter + 1;
evnt.ReduceInterlace = true;
}
eventEnum.moveNext();
}
}

trackEnum.moveNext();
}

MessageBox.Show(counter + " events changed.","Finished");

} catch (e) {
MessageBox.Show(e);
}

/** END **/
JohnnyRoy wrote on 5/13/2007, 10:31 AM
If this is the ReduceInterlaceFlicker.js script that I wrote and placed on the VASST site, I cannot reproduce this problem. I just downloaded it from VASST and it works fine for me in Vegas 7.0e. Maybe you have an older version of the script? Also edit the file and make sure your browser didn't add any junk to it. I know some popup blockers add a routine to all JavaScript files and, of course, since this file is not intended for the web, it breaks when run in Vegas. The file should look like this:

/**
* Program: ReduceInterlaceFlicker.js
* Description: This script will turn on the Reduce Interlace Flicker switch
* for all selected events.
* Author: Johnny "Roy" Rofrano jrofrano [at] vasst {dot} com
* Date: December 9, 2005
**/
import System.Windows.Forms;
import Sony.Vegas;

var counter = 0; // used for user feedback
try
{
// iterate over all the tracks
for (var videoTrack in Vegas.Project.Tracks)
{
// only process video tracks
if (!videoTrack.IsVideo()) continue;

// iterate over all the evnts
for (var videoEvent in videoTrack.Events)
{
// only process selected events
if (videoEvent.Selected)
{
// turn on the reduce interlace switch
videoEvent.ReduceInterlace = true;
counter++;
}
}
}
// Tell the user how many we changed
MessageBox.Show(counter + " video event(s) changed.");
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}

~jr
Grazie wrote on 5/13/2007, 10:42 AM
Thanx jr - that did it. Kick-out the OLD!!
rs170a wrote on 5/14/2007, 4:04 AM
Thanks for the script update.
I was still having problems with some of my other scripts (in the package from Carson's site) so I downloaded it again and re-copied them to the script folder. Problem solved :-)

Mike