Scrolling display of timeline

nolty wrote on 11/15/2004, 10:37 PM
Hi all --

I'm about finished with my first major scripting effort, an interactive regions list. I have it doing everything I want, except one thing. When the user double clicks a region in the list, that region is selected in the timeline and the timeline cursor is moved to the beginning of the region. However, if the region happens to be off-screen (for example, the timeline is currently displaying 1:00:00 through 2:00:00, but the region is between 3:01:00 and 3:02:00), just moving the cursor there doesn't make it visible. I didn't notice anything in the Vegas scripting API that lets me control what is viewed on the timeline -- is there such a thing?

I'll post my script soon.

Thanks!
Bob

Comments

dust wrote on 11/16/2004, 12:35 AM
Unfortunately there's no way to directly influence the timeline display from scripts (it's one of the things I'm missing too). You can, however, user the wsh (windows script host) interface to "send" keystrokes to Vegas that are activated after the script finished; if you basically send a left-arrow followed by a right-arrow (or, better F3 followed by F9, that basically do the same thing), this will then adjust the timeline such that the cursor becomes visible - as it would if you pressed the keys manually. Thw following code (after having set the cursor!)= at the end of teh script should do the jon:


import Microsoft.Win32;
...
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.SendKeys("{F3}"); // Sends Right Arrow to Vegas
WshShell.SendKeys("{F9}"); // Sends Left Arrow to Vegas


good luck, Andy
johnmeyer wrote on 11/16/2004, 9:03 AM
This is a limitation, but depending on exactly what you want to do, refreshing the display with this command is sometimes useful:
        Vegas.UpdateUI(); 
nolty wrote on 11/17/2004, 1:42 AM
Dust -- thanks for the pointer, I used it, but see my additional remarks in another thread.

John -- thanks for the idea, but it was not effective in this case.

Bob