📝⚙️(Script) Specific selection

m3lquixd wrote on 3/10/2023, 5:57 AM

I don't like how "CTRL+A" works in VEGAS. It selects all events and tracks. So after I do what I want to do I have to deselect the events as well as the tracks.
I would like a script that identifies when I click on the timeline and run it, it selects all events on the timeline, but when I click on a track and run it, it selects all tracks.
Is there any way for a script to identify that I've clicked on the timeline and when I click on the tracks?

Last changed by m3lquixd

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

Comments

m3lquixd wrote on 3/10/2023, 6:07 AM

@jetdv If there is no way to do this identification, I would be grateful with separate scripts. One for tracks and one for events.

Last changed by m3lquixd on 3/10/2023, 6:07 AM, changed a total of 1 times.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

jetdv wrote on 3/10/2023, 7:23 AM

@m3lquixd, the scripting requests should really be posted under the "scripting" category.

You'll need two separate scripts. But there is some clarification needed...

When selecting all events, do you also deselect all tracks?

When selecting all tracks, do you also deselect all events?

Or, in both cases, do you select as needed but leave other selected items alone?

 

These can both be easily created once there are answers to the clarifications. The basics for doing both are here.

jetdv wrote on 3/10/2023, 7:40 AM

Select all tracks while deselecting all events.

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                myTrack.Selected = true;
                foreach (TrackEvent evnt in myTrack.Events)
                {
                    evnt.Selected = false;
                }
            }
        }
    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

 

Select all events while deselecting all tracks:

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                myTrack.Selected = false;
                foreach (TrackEvent evnt in myTrack.Events)
                {
                    evnt.Selected = true;
                }
            }
        }
    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

the only difference between the two are the "true" and "false" are swapped. This just go through all tracks and all events on the tracks the same as the previous script you requested. Then it just sets the "selected" value to true or false for the event or track.

vkmast wrote on 3/10/2023, 7:47 AM

Moved to the Scripting section.

m3lquixd wrote on 3/10/2023, 7:54 AM

@jetdv It worked!
Is there a way to make one that selects all events from just one track?
It could be like this, when I select a track and run the script, it selects all the events on that track. If there's no way to select the track, it could be when I select any event on that track and run the script, it will select all the events on that track. It's the same, what matters is that I can indicate which track I want to select.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

m3lquixd wrote on 3/10/2023, 7:59 AM

@vkmast 

Please if possible. Move these other posts of mine to the scripting category.

Script that adds Picture-in-Picture to event.
Script to turn on alpha channel.
Vegas Text To PNG Image?

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

jetdv wrote on 3/10/2023, 8:11 AM

Here's how I typically select events...

My usage is usually to "select everything after the cursor" as I often need to move things "to the right of the cursor" either left so I can close a hole I just made or right to create a hole to insert something else.

But yes, that can easily be done. Where it says "myTrack.Selected = false;", we remove that as we're not changing the track selection anymore.

Then we can just set the event selected = track selected for all events. So if the track is selected, the event will become selected. If the track is not selected, the event will become not selected.

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                foreach (TrackEvent evnt in myTrack.Events)
                {
                    evnt.Selected = myTrack.Selected;
                }
            }

Excalibur is my Custom Command I started creating at version 4 of Vegas and continued expanding it to its current form.

m3lquixd wrote on 3/10/2023, 8:21 AM

Thanks! 😁

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

vkmast wrote on 3/10/2023, 8:33 AM

@vkmast 

Please if possible. Move these other posts of mine to the scripting category.

Script that adds Picture-in-Picture to event.
Script to turn on alpha channel.
Vegas Text To PNG Image?

@m3lquixd done.