OK, Ed, I tried (and FAILED)!! I looked at another script in Vegas Pro 18 and one from a third party and tried to make sense of an emulate what I thought was correct, but not knowing what I am doing and scouring the web for some tutorials, my script (entitled Black 1 Sec Video Clip.cs) looks like this:
using ScriptPortal.Vegas;
//Add the Generated Media
string GenMed = “{Svfx:com.vegascreativesoftware:solidcolor}”; //Magix Solid Color
Media media = common.CreateGeneratedMedia(GenMed, “Black”);
MediaStream stream = media.Streams[0] as MediaStream;
VideoEvent newEvent = new VideoEvent(0, 1);
myTrack.Events.Add(newEvent);
Take take = new Take(stream);
newEvent.Takes.Add(take);
My error requester box says “An error occurred during execution of the script D:\Program Files\VEGAS\Vegas Pro 18.0\Script Menu\Black 1 Sec Video Clip.cs. Error 0x80131600 (message missing)”
Details of the error:
D:\Program Files\VEGAS\Vegas Pro 18.0\Script Menu\Black 1 Sec Video Clip.cs(5) : Unexpected character ‘“’
D:\Program Files\VEGAS\Vegas Pro 18.0\Script Menu\Black 1 Sec Video Clip.cs(5) : Unexpected character ‘”’
D:\Program Files\VEGAS\Vegas Pro 18.0\Script Menu\Black 1 Sec Video Clip.cs(7) : Unexpected character ‘“’
D:\Program Files\VEGAS\Vegas Pro 18.0\Script Menu\Black 1 Sec Video Clip.cs(7) : Unexpected character ‘”’
D:\Program Files\VEGAS\Vegas Pro 18.0\Script Menu\Black 1 Sec Video Clip.cs(5) : A namespace cannot directly contain members such as fields or methods
D:\Program Files\VEGAS\Vegas Pro 18.0\Script Menu\Black 1 Sec Video Clip.cs(9) : Identifier expected
D:\Program Files\VEGAS\Vegas Pro 18.0\Script Menu\Black 1 Sec Video Clip.cs(10) : Expected class, delegate, enum, interface, or struct
D:\Program Files\VEGAS\Vegas Pro 18.0\Script Menu\Black 1 Sec Video Clip.cs(12) : Expected class, delegate, enum, interface, or struct
Again, this is Greek to me! I haven’t a clue what to make of the error as I never have studied computer programming nor specifically this C# language. I just am grasping at straws!!
Can you correct this to work for me, please? I changed the color to Black and the length to 1. Probably the latter is incorrect verbiage for 1 second. I set the start to 0 (probably wrong also) and I don’t know what to do with myTrack.
Since you know exactly what I am trying to accomplish, your correcting the errors to my .cs script will allow me to accomplish my goal. I applaud and appreciate your efforts and hope that you will be able to help me (yet once again as you have done so several times in the past with other issues).
Perhaps maybe some of the errors are because you wrote it in Javascript and mine is in C#? Other than that, well…???
Thanks in advance, Ed.