-
Hi Edward or John….
Posted by Steve Rhoden on December 20, 2012 at 2:44 pmHi Guys, Sometime ago Edward wrote a split events script for
splitting a selected event (not all the events at once),
instead of pressing the “s” key. Would appreciate if one of you
can provide me with such a script once again… Thanks.Steve Rhoden
(Cow Leader)
Film Editor & Compositor.
Filmex Creative Media.
https://www.facebook.com/FilmexCreativeMedia
1-876-832-4956John Rofrano replied 13 years, 4 months ago 6 Members · 22 Replies -
22 Replies
-
John Rofrano
December 20, 2012 at 3:28 pmHi Steve,
I just wrote this for you. Enjoy 😉
///**********************************************************************
/// Program: SplitAtCursor.cs
/// Author: John Rofrano
/// Description: This script will split the selected event at the
/// current cursor position.
/// Last Updated: December 20, 2012
/// Copyright: (c) 2012 Sundance Media Group, All Rights Reserved
///**********************************************************************
using System;
using System.Windows.Forms;
using Sony.Vegas;class EntryPoint
{
public void FromVegas(Vegas vegas)
{
try
{
TrackEvent selectedEvent = GetSelectedEvent(vegas);
if (selectedEvent != null)
{
// make sure that the cursor is within the event boundaries
if (vegas.Transport.CursorPosition > selectedEvent.Start && vegas.Transport.CursorPosition < selectedEvent.End)
{
selectedEvent.Split(vegas.Transport.CursorPosition - selectedEvent.Start);
}
else
{
throw new ApplicationException("Cursor is not within the selected event.");
}
}
else
{
throw new ApplicationException("No event selected.");
}
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Split At Cursor", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}///
/// Returns the first selected event
///
TrackEvent GetSelectedEvent(Vegas vegas)
{
foreach (Track track in vegas.Project.Tracks)
{
foreach (TrackEvent trackEvent in track.Events)
{
if (trackEvent.Selected)
{
return trackEvent;
}
}
}return null;
}
}
~jr
http://www.johnrofrano.com
http://www.vasst.com -
Stephen Mann
December 20, 2012 at 4:24 pmI don’t follow. If I want to split a single event and not the other events on other tracks, I just select the event and hit “S”. Why do I need a script?
Steve Mann
MannMade Digital Video
http://www.mmdv.com -
Steve Rhoden
December 20, 2012 at 4:29 pmThanks a lot John, But unfortunately this thing is messing with me
and wont copy from here properly….lol. I should have mentioned
that i want to drop this in Vegas 10. Thanks.Steve Rhoden
(Cow Leader)
Film Editor & Compositor.
Filmex Creative Media.
https://www.facebook.com/FilmexCreativeMedia
1-876-832-4956 -
Steve Rhoden
December 20, 2012 at 4:37 pmYou dont need to follow Stephen, dont you realise it is i who
is requesting this and not a novice? Therefore it should be obvious
to you that I need the script for a specific reason.Steve Rhoden
(Cow Leader)
Film Editor & Compositor.
Filmex Creative Media.
https://www.facebook.com/FilmexCreativeMedia
1-876-832-4956 -
Graham Bernard
December 20, 2012 at 6:53 pmDitto Steve R. John. I can’t copy this into Notepad from here.
Grazie
Video Content Creator and Potter
PC 7 64-bit 16gb * Intel® Core™i7-2600k Quad Core 3.40GHz * 2GB NVIDIA GEFORCE GTX 560 Ti
Cameras: Canon XF300 and two elderly XM2s -
John Rofrano
December 20, 2012 at 7:08 pm[Graham Bernard] “Ditto Steve R. John. I can’t copy this into Notepad from here.”
OK. I uploaded it to my web site. Here is the link:
Just right-click and “Save Link As…”
~jr
http://www.johnrofrano.com
http://www.vasst.com -
Graham Bernard
December 20, 2012 at 7:17 pmJohn? I got this Error:
C:Program FilesSonyVegas Pro 12.0Script MenuSplitEventAtCursor.cs(63) : } expected
C:Program FilesSonyVegas Pro 12.0Script MenuSplitEventAtCursor.cs(63) : } expectedVideo Content Creator and Potter
PC 7 64-bit 16gb * Intel® Core™i7-2600k Quad Core 3.40GHz * 2GB NVIDIA GEFORCE GTX 560 Ti
Cameras: Canon XF300 and two elderly XM2s -
John Rofrano
December 20, 2012 at 7:32 pmSorry I can’t recreate that error. Maybe your browser or antivirus software is inserting something into the file (I’ve seen that happen before). Open the file and make sure that it looks like the listing I posted.
I’m using the Chrome browse and I just right-clicked and saved it to my desktop and ran the script fine.
~jr
http://www.johnrofrano.com
http://www.vasst.com -
Steve Rhoden
December 20, 2012 at 8:50 pmWonderful John, Wonderful. Thats exactly what i wanted.
Thanks very much for the extra effort on this. I needed a
good functional script of this kind in order to construct
some other scripting ideas i have in my head for Vegas 10.
The scripting language always takes me for a loop…lol.As i mentioned earlier, regarding that unnecessary tone
from Stephen. A requested such as this coming from me, must
be for another specific reason.Steve Rhoden
(Cow Leader)
Film Editor & Compositor.
Filmex Creative Media.
https://www.facebook.com/FilmexCreativeMedia
1-876-832-4956 -
Stephen Mann
December 20, 2012 at 10:17 pmThat’s why I am confused, Steve. It takes more keystrokes to run a script than to simply select an event and split it.
Steve Mann
MannMade Digital Video
http://www.mmdv.com
Reply to this Discussion! Login or Sign Up