Sony Vegas Script

abhiryder89 wrote on 2/9/2021, 1:33 PM

Hi all.

So ive been playing around with Sony Vegas scripts using Javascript and have been having a great ol time. I managed to make a script that will split my video based on my sequence/scrubber/cursor thingie (insert its official name here) location and thats all well and good but the idea occurred to me to have it automatically split the video at markers that ive already placed. The only issue is that I have no clue how to tell vegas (using javascript) where those markers are so it can split the video. If that made any sense. Does anyone know how I could go about this or have any resources they can direct me to? Thanks for taking the time to read this :) https://9apps.ooo/

Comments

jetdv wrote on 2/9/2021, 5:03 PM

Which version of Vegas are you using?

The current versions (since 13) are Magix versions. Sony purchased VEGAS at version 4 and sold it at version 13.

You mentioned using javascript. While that will certainly work, most examples you will see today are written in C#. Here's how you can go through the markers in c#.

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            foreach (Marker myMarker in myVegas.Project.Markers)
            {
                //Process "myMarker"
            }
        }
    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

You might also want to take a look at my new tutorials over at www.jetdv.com. So far I've covered what you need to write scripts in Vegas, how to go through the tracks and events on the timeline, how to do debugging with breakpoints, and would welcome requests and guidance on what topics need to be covered. Future topics already include splitting a stereo event into two mono events, creating a script that has a form, and selecting a region (very similar to markers).

You might also take a look at Excalibur which has a "Split at Markers" tool built-in.