Hello experts and a happy new year to you all!
I would like to realize the following with the script:
- Go to first track
- Select only last event
It throws this error message:
"; expected."
"Expression has no effect."
"Variable i not declared."
import SonicFoundry.Vegas; import System.Windows.Forms; try { var tracks = Vegas.Project.Tracks; int i == 0; for (var evnt in tracks.Events) // Step through all 10 events { i++ // Increment by 1 if (i == 10) // If it's the 10th event (should be the last): { evnt.Selected = true; // Select this event } } } catch (errorMsg) { MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
I know using the incrementer logic is not good, but I have no idea
if there is some "Select.tracks.events.last" method.
And in my case 10 would be enough, but I could always raise it to an unrealistic value.
Any help will be appreciated!
Best regards,
Stefan