Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums VEGAS Pro Vegas Pro 9 script compatibility

  • Vegas Pro 9 script compatibility

    Posted by Paul Goelz on December 23, 2009 at 3:04 pm

    Tried to search for the answer to this but came up mostly empty….

    Just got Vegas Pro 9 and am looking into scripting. I want a script that will add a marker to the beginning of every clip on the timeline and I found one or two that seem to do that. Trouble is that they error out, mostly with “undefined variable” warnings. I suspect the problem is that they are fairly old and written for a previous version of Vegas?

    If so, how are you supposed to tell what script works for what version of Vegas…. most are not identified externally or internally.

    And to cut to the chase… anyone know where I can find a Vegas 9.0b Pro script that adds a marker to the beginning of each clip?

    TIA,
    Paul

    Paul Goelz replied 16 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • John Rofrano

    December 23, 2009 at 7:23 pm

    > If so, how are you supposed to tell what script works for what version of Vegas…. most are not identified externally or internally.

    Well… that’s why people buy professionally written scripts like Ultimate S Lite/Pro and Excalibur so that someone else can maintain that for you. 😉

    Internally you an tell because older scripts were written when Sonic Foundry owned Vegas and they import SonicFoundry.Vegas. Sony scripts will import Sony.Vegas. Most of the time all you have to do is change the line:

    import SonicFoundry.Vegas;

    to

    import Sony.Vegas;

    and the script will work.

    > And to cut to the chase… anyone know where I can find a Vegas 9.0b Pro script that adds a marker to the beginning of each clip?

    For free… this should do the trick:


    /**
     *   Program: MarkersAtEvents.cs
     *    Author: John Rofrano
     *   Purpose: This script will place a marker at each event on the selected track(s)
     * Copyright: (c) 2009, Sundance Media Group / VASST
     *   Updated: December 23, 2009
     **/

    using System;
    using System.Windows.Forms;
    using Sony.Vegas;

    class EntryPoint
    {
        public void FromVegas(Vegas vegas)
        {
            foreach (Track track in vegas.Project.Tracks)
            {
                // only process selected tracks
                if (!track.Selected) continue;

                foreach (TrackEvent trackEvent in track.Events)
                {
                    Marker marker = new Marker(trackEvent.Start, trackEvent.ActiveTake.Name);
                    try
                    {
                        vegas.Project.Markers.Add(marker);
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(String.Format("Could not place a marker at {0}\nError message is: {1}", trackEvent.Start.ToString(), e.Message), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
        }
    }

    ~jr

    http://www.johnrofrano.com
    http://www.vasst.com

  • Paul Goelz

    December 23, 2009 at 7:40 pm

    Ah, thanks, got it. Changing that import line from Sonicfoundry to Sony did the trick. And thanks for the script too. I’ll give it a try. It looks similar to the one I had already found that now works after changing the import line.

    I’ll also have a look at your paid scripts and see if there is anything I can’t live without 😉

    Thanks again,
    Paul

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy