Scripting Question

pgfitzgerald wrote on 10/20/2005, 8:55 AM
FYI: I'm a long time Vegas user, but have been away for quite some time... :-)

Is there any way to run a script from outside Vegas that would start the program, process some video, and exit the program?

The only reference I've been able to find is here:
http://www.custcenter.com/cgi-bin/sonypictures.cfg/php/enduser/std_adp.php?p_faqid=903

It's quite old, so I wanted to see if the situation has changed, or it someone knows of a workaround.

Thanks,

Paul

Comments

jetdv wrote on 10/20/2005, 9:17 AM
Yes there is. Create a batch file with the following line (adjust the path(s) as needed):

"c:\Program Files\Sonic Foundry\Vegas 6.0\vegas60.exe" -SCRIPT:"d:\MyScript.js"

This will start Vegas 6 and then automatically start "MyScript" stored on drive D.

It is then up to the script to properly close the file (ignoring changes or saving changes as needed) and then exit Vegas. One way to do this is:


// Temporarily save the current project and then start a new project.
// Gets around any "project not saved" problems
Vegas.SaveProject(TempSave);
Vegas.NewProject(false, false);
// Delete the temporary check file
File.Delete(TempSave);
// Exit Vegas
Vegas.Exit();


While all of the above may not be necessary, it works for one instance where I am doing this. However, there is still a slight problem - sometimes the Vegas PROCESS does not end.

For this particular person, I now create a file during the exiting process. If that file exists, their controlling program will then kill the Vegas process (if it did not do so by itself) and then delete the file for use the next time.
pgfitzgerald wrote on 10/20/2005, 1:38 PM
That will work perfectly!

Thanks,

Paul