Hi all,
Can someone help me with the following peice of a script. Basically, I'm trying to place a audio file into the project at the current cursor location. I am using vbscript. Thx......
dim newMedia as new Media("C:\audio\backup\QCELP\081004_A_E3.wav")
dim newStream = newMedia.Streams.GetItemByMediaType(MediaType.Audio, 0)
dim newEvent as new AudioEvent(VegasApp.Cursor, newStream.Length)
VegasApp.Project.Tracks(2).Events.Add(newEvent)
dim take as new Take(stream)
newEvent.Takes.Add(take)
I get the follwing error when I run this....
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object variable or With block variable not set.
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
Can someone help me with the following peice of a script. Basically, I'm trying to place a audio file into the project at the current cursor location. I am using vbscript. Thx......
dim newMedia as new Media("C:\audio\backup\QCELP\081004_A_E3.wav")
dim newStream = newMedia.Streams.GetItemByMediaType(MediaType.Audio, 0)
dim newEvent as new AudioEvent(VegasApp.Cursor, newStream.Length)
VegasApp.Project.Tracks(2).Events.Add(newEvent)
dim take as new Take(stream)
newEvent.Takes.Add(take)
I get the follwing error when I run this....
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object variable or With block variable not set.
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)