I have the following script!
--------------------------
Imports System
Imports System.IO
Imports System.Windows.Forms
Imports SonicFoundry.Vegas
Imports System.Collections
Public Module MainModule
Public Sub Main()
Dim anEnum As IEnumerator
Dim Vegas As SonicFoundry.Vegas.Vegas
Try
MessageBox.Show(Vegas.Project.FilePath)
Catch objE As Exception
MessageBox.Show(objE.Message & Chr(10) & objE.StackTrace.ToString & Chr(10))
End Try
End Sub
End Module
------------------------------------------
And when I run it I get the Catch Code and in the messageBox it says.
"Object Reference not se tto an instance of an object.
at SonicFoundry.Vegas.MainModule.Main() in sonicfoundry://VegasScript/__ScriptText__: line 15"
And line 15 is of course the Try to show the Project Filepath!
I have coded this in VS.NET and with the code complete funtion on and VS.NET does'nt underline anything so I wonder what else I can do? Don't you make an instance of the VegasObject like that? There's no New() method on the Vegas so I can't really use that, or can I?
I suspect I have no "Project"-Object and that's what giving the error. How do I use the Loaded Project?
Thanx in advance!
--------------------------
Imports System
Imports System.IO
Imports System.Windows.Forms
Imports SonicFoundry.Vegas
Imports System.Collections
Public Module MainModule
Public Sub Main()
Dim anEnum As IEnumerator
Dim Vegas As SonicFoundry.Vegas.Vegas
Try
MessageBox.Show(Vegas.Project.FilePath)
Catch objE As Exception
MessageBox.Show(objE.Message & Chr(10) & objE.StackTrace.ToString & Chr(10))
End Try
End Sub
End Module
------------------------------------------
And when I run it I get the Catch Code and in the messageBox it says.
"Object Reference not se tto an instance of an object.
at SonicFoundry.Vegas.MainModule.Main() in sonicfoundry://VegasScript/__ScriptText__: line 15"
And line 15 is of course the Try to show the Project Filepath!
I have coded this in VS.NET and with the code complete funtion on and VS.NET does'nt underline anything so I wonder what else I can do? Don't you make an instance of the VegasObject like that? There's no New() method on the Vegas so I can't really use that, or can I?
I suspect I have no "Project"-Object and that's what giving the error. How do I use the Loaded Project?
Thanx in advance!