Selected Media in Mediapool

philpw99 wrote on 11/3/2003, 11:40 PM
Hi, please help me out, I really need this answer.

Is there a way to know which media file is selected in mediapool? The document didn't say there is a "selected" property with media class. But is there any technique to know which one is selected? It will be quite helpful if I can select media in mediapool and use a script to send them to mediapool.

By the way, as a thank you for your time. I got 1 script here. It can deleted all the not active takes, so you can apply media cleanup more effeciently.


/**
* Program: RemoveNotActiveTakes.js
* Description: This script will all the takes that's not active.
* Author: Philip
*
* Date: Oct 30, 2003
**/

import SonicFoundry.Vegas;
import System.Windows.Forms;
import Microsoft.Win32;

try
{
// step through all video events:
for (var track in Vegas.Project.Tracks) {
for (var evnt in track.Events) {
for (var take in evnt.Takes){
if (!take.IsActive)evnt.Takes.Remove(take);
}

}
}

}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}

Comments

SonyPJM wrote on 11/13/2003, 3:35 PM
Sorry, no way at the moment to determine via scripting which media objects are selected in the media pool.

This is on my list of things to do for an upcoming release.
Rosebud wrote on 5/22/2007, 1:27 PM
No change since 2003 ?
SonyPJM wrote on 5/30/2007, 2:10 PM
You still can't determine which media is selected in Vegas 7. Stay tuned though.