John Perkins
01-06-2006, 01:08 AM
I saw a request for sending commands to other windows from TScript so I thought I would post this plugin for VT4.6.
Last year I played around with sending commands and variables between windows so I stripped out some (mostly) broken functions and here it is.
Put this into the Plugins/VT folder and you will gain a cross window command like this:
SendScript( <the module name>, <script command>)
For example - SendScript("Switcher_Tabbed","Auto()")
You can call this from any script you like, and if a switcher is open, it will respond. If you format the SendScript command wrong, it will let you know there is a syntax error, but unfortunately there is no error returned if the command fails in this version. :-(
I've also noticed a few new window names you can address. the full list (I think) as of VT4.6 is:
"Desktop2"
"StretchyFileBin"
"ColorChooser_Global"
"AboutWindow"
"Preferences"
"Switcher_Tabbed"
"Desktop2_MenuBar"
"VideoEditor"
"RecordPanel"
"WaveformVectorScope"
"ToasterVision"
"AudioMixer3"
"VideoEditor_DDR"
"BackgroundGenerator"
"KeyerControl"
"CrossKeyer"
"CGToaster"
"ProcAmp"
"BobWindow"
"CGMiniToaster"
"ExternalSource2_UI"
"ExternalApp_Aura"
"VideoEditor_BatchCapture"
"GizmosControl"
"Switcher_ExternalVGA_Standalone"
"LiveStreamDlg"
"CGLive::PopupModule" - Title Templates! Any commands?
An advanced example of usage is this:
//Pointless remake of the launch command
//Only launches if one isn't already open
AddMenuItem("Open VTStream", code(
SendScript("Desktop2","if(!IsPluginRunning(\"LiveStreamDlg\")) Launch(\"LiveStreamDlg\",\"LiveStreamDlg\"") )
)
If you need to use a quote in the command, escape it with \ before it.
You can also combine lines of script into one long unreadable one as in my example.
Have a ball, I hope it works for you,
Last year I played around with sending commands and variables between windows so I stripped out some (mostly) broken functions and here it is.
Put this into the Plugins/VT folder and you will gain a cross window command like this:
SendScript( <the module name>, <script command>)
For example - SendScript("Switcher_Tabbed","Auto()")
You can call this from any script you like, and if a switcher is open, it will respond. If you format the SendScript command wrong, it will let you know there is a syntax error, but unfortunately there is no error returned if the command fails in this version. :-(
I've also noticed a few new window names you can address. the full list (I think) as of VT4.6 is:
"Desktop2"
"StretchyFileBin"
"ColorChooser_Global"
"AboutWindow"
"Preferences"
"Switcher_Tabbed"
"Desktop2_MenuBar"
"VideoEditor"
"RecordPanel"
"WaveformVectorScope"
"ToasterVision"
"AudioMixer3"
"VideoEditor_DDR"
"BackgroundGenerator"
"KeyerControl"
"CrossKeyer"
"CGToaster"
"ProcAmp"
"BobWindow"
"CGMiniToaster"
"ExternalSource2_UI"
"ExternalApp_Aura"
"VideoEditor_BatchCapture"
"GizmosControl"
"Switcher_ExternalVGA_Standalone"
"LiveStreamDlg"
"CGLive::PopupModule" - Title Templates! Any commands?
An advanced example of usage is this:
//Pointless remake of the launch command
//Only launches if one isn't already open
AddMenuItem("Open VTStream", code(
SendScript("Desktop2","if(!IsPluginRunning(\"LiveStreamDlg\")) Launch(\"LiveStreamDlg\",\"LiveStreamDlg\"") )
)
If you need to use a quote in the command, escape it with \ before it.
You can also combine lines of script into one long unreadable one as in my example.
Have a ball, I hope it works for you,