FORUMS: list search recent posts

Vegas script that call external program or user input

COW Forums : VEGAS Pro

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Xun Changhai
Vegas script that call external program or user input
on Aug 24, 2014 at 4:27:33 pm

Hi.

I need a Sony vegas JS script command that call an external command line tools, and get the returned data. Or a script that prompt for user input. I've read through Vegas scripting API but can't find any info about this. Can someone point me to the right direction? Thanks.


Return to posts index

John Rofrano
Re: Vegas script that call external program or user input
on Aug 24, 2014 at 5:37:15 pm

[Xun Changhai] "I've read through Vegas scripting API but can't find any info about this."
That's because it has nothing to do with the Vegas Script API. This would be regular code that you would write regardless of if Vegas was running it or not.

I don't do JS but code to run a command and get it's output looks like this in C#:

///*******************************************************************
/// Program: DirCommand.cs
/// Author: John Rofrano
/// Description: This script demonstraits how to run a command and
/// retrieve it's output
/// Last Updated: August 24, 2014
/// Copyright: (c) 2014 Sundance Media Group, All Rights Reserved
///******************************************************************
using System;
using System.Windows.Forms;
using Sony.Vegas;

class EntryPoint
{
public void FromVegas(Vegas vegas)
{
try
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/c dir";
process.StartInfo = startInfo;
process.Start();
string output = process.StandardOutput.ReadToEnd();
MessageBox.Show(output);
process.WaitForExit();
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
}

Substitute your own command for "cmd.exe" and pass it whatever arguments you need.

~jr

http://www.johnrofrano.com
http://www.vasst.com



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]