new to Vegas scripting, cant run ShowVersion.vb

ErikS wrote on 2/24/2012, 8:54 AM
Hello all,
I am very new to vegas scripting. I program exclusively in VB, mostly in VBA for office programs, reflection for windows, and visual studio 6. I downloaded the developers kit for Vegas 10 (as I am using Vegas 10, 64bit). I tried running the supplied "ShowVersionVB.vb" in Vegas and Vegas spit out an error with the details "System.NotSupportedException: Language not supported.
at Sony.Vegas.ScriptHost.RunScript(Boolean fCompileOnly)". so this is problem one.
Second issue, can you use Visual Basic 2010 express for sony code debugging? I have had no success with this as of yet.
Any help on either of these topics would be greatly appreciated.
Thanks,
Erik

Comments

Gary James wrote on 2/24/2012, 11:20 AM
Erik. I'm not familiar with the "ShowVersionVB.vb" script. Is this a stand-alone .VB file, or is it a DLL?

I'm not aware of any way to debug a text script file, but you can easily debug a script or command extension DLL. The first thing you need to do is, add a line to the Project Property page Post-build event command line, under the Build Events Tab. It should look something like this:

xcopy /R /Y "$(TargetPath)" "FullPath To Your Script Subdirectory"

Substitute my comment with your Vegas Script sub-directory path string. This automatically copies your script DLL to your Vegas script directory every time you make a new build of your project.

To debug your DLL you will need to do the following:

1. Build your script DLL using Debug settings. Make sure it got copied to your Vegas script sub-directory.
2. Set a breakpoint in your script DLL project start-up code inside Visual Studio.
3. Start Sony Vegas Pro outside of Visual Studio as you normally would.
4. From the Visual Studio Menu bar select "Tools / Attach To Process ..."
5. Find Sony Vegas Pro in the list of Available Processes. Select it, and press the Attach button.
6. Launch your script dll from inside Sony Vegas Pro.
7. You should see your breakpoint get hit inside Visual Studio.

Now you can debug as you normally would. If you need to make any changes to your DLL code, you'll have to close Sony Vegas before you rebuild your DLL. Even if Vegas is no longer using your script, it holds the DLL open. And that prevents it from being overwritten.

Gary ...
ErikS wrote on 2/24/2012, 12:02 PM
The ShowVersion.vb is a standalone VB file, that is part of the developement kit you can download from the vegas website. Downloads>Developement Kits
Erik
ErikS wrote on 2/24/2012, 12:16 PM
Also, are these instructions for Visual Basic 2010 EXPRESS, I can not find any option anywhere for Build options under any property page tab. This is just microsofts free version, not any purchased version...
Gary James wrote on 2/24/2012, 3:00 PM
Erik, here are some screen-shots of my PC and my Timeline Tools project.

To bring up the Project Property Pages dialog right-click on the solution in the Solution Explorer:



Click on the Properties menu item, and this brings up the Properties dialog:



Select the Build Events Tab and enter the line shown in the Post event command line.

I'm using Visual Studio 2010 Premium, so I can't be sure if your version supports this. In any case, this step was only a convenience in setting up a Post Build action that copied your project DLL to the Sony Vegas Pro script sub-directory. If your copy of VS2010 Express doesn't have this, then you'll simply have to manually copy the DLL after each build.

This is not really relevant to your question of how to debug your script. That's where you need to follow the other steps I outlined for you.
altarvic wrote on 2/25/2012, 2:58 AM
You should use C# or JScript
VB scripts are not supported in 64bit environment
JohnnyB wrote on 3/22/2012, 1:15 PM
Please check your references are pointing to the right Vegas dll, and the compiler settings are targeting the right CPU.

I'd support using c# for this, you're much more likely to get decent samples and experience, while the learning curve isn't very steep to achieve something useful.