Hello!
Software: Magix Vegas Pro 17, Windows 10 64 Bit Pro
I'm new and must admit that I have very little knowledge of programming (especially .cs).
I found an interesting script which selects ALL events of ALL tracks under the cursor position,
using System; using System.Windows.Forms; using ScriptPortal.Vegas;namespace ClassLibrary3 { public class EntryPoint { public void FromVegas(Vegas vegas) { try { DeselectAll(vegas); // step through all the tracks foreach (var track in vegas.Project.Tracks) { // Step through all events foreach (var evnt in track.Events) { // Check to see if event is under or to the right of the cursor //if (-1 == vegas.Cursor.CompareTo(evnt.Start + evnt.Length)) if (evnt.Start <= vegas.Transport.CursorPosition && evnt.End >= vegas.Transport.CursorPosition) { evnt.Selected = true; } else { evnt.Selected = false; } } } } catch (Exception e) { MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } public void DeselectAll(Vegas vegas) {// step through all the tracks foreach (var track in vegas.Project.Tracks) { // Step through all events foreach (var evnt in track.Events) { evnt.Selected = false; } } return; } } }
I would like to modify the script, so that it only selects 1 event of the currently highlighted track.
After several trials and errors I finally gave up!
Can you assistent, please?
Thanks for any help and best regards!