FORUMS: list search recent posts

How to pull a script from a web page

COW Forums : VEGAS Pro

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Grace Hunter
How to pull a script from a web page
on Jun 25, 2014 at 1:39:17 am

At the bottom of this post is a script. I copied this script from another post, and put it into a notepad document and saved it as a js file. Then I tried to run the script in vegas pro. I got this message:




What's wrong and how do I not have this problem in the future?


// Close Gaps For Multiple Tracks

using Sony.Vegas;
using System.Collections.Generic;

public class EntryPoint {

Vegas myVegas;

//Change this to false if you want to affect only selected events
bool ALLEVENTS = true;

public void FromVegas(Vegas vegas)
{
SelectedEvents Selected = new SelectedEvents(vegas,ALLEVENTS);
Selected.SortByStartTime();
for(int i = 0; i < Selected.Events.Count - 1; i++)
{
Selected.Events[i+1].Start = Selected.Events[i].End;
}
}


}

public class SelectedEvents
{
public List Events;

public SelectedEvents(Vegas vegas, bool allevents)
{
Events = new List();
foreach(Track t in vegas.Project.Tracks)
{
foreach(TrackEvent ev in t.Events)
{
if (ev.Selected || allevents) Events.Add(ev);
}
}
}

public void SortByStartTime()
{
Events.Sort((x,y) => x.Start.CompareTo(y.Start));
}

}


Return to posts index

Matt Carlson
Re: How to pull a script from a web page
on Jun 25, 2014 at 2:14:45 am

I answered in the other thread as well... the extension needs to be .cs for the script.

If you want to avoid any copy/paste problems here is a link to the script file

7669_closegapsmultipletracks.cs.zip


Return to posts index

Matt Carlson
Re: How to pull a script from a web page
on Jun 25, 2014 at 4:33:19 am

I see the problem here. The Creative Cow forum is messed up. In order for scripts to show up nicely in a post we are given a code tag to wrap them in. This tag is supposed to keep it nice to look at and not use any of the other filters that the forum posts use. Unfortunately the the code tag is broken it seems. It is filtering out < > symbols. The List lines should read like: new List< TrackEvent > (); These have been removed by the filters breaking the script.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]