Comments

rcampbel wrote on 1/3/2005, 7:13 PM
Are you starting your script from within Vegas, or from a windows command prompt?

If from a windows command prompt, then Vegas is likely getting started with a -SCRIPT argument that tells it to run the script. You can run the script in the current instance of Vegas, just by going to Tools, Scripting, Run Script and selecting the .js or .vb script file.

Randall
hdguru wrote on 1/4/2005, 10:42 AM
Complete automation is the end goal.

My script is being executed by command line via a .vbs file running as a scheduled task. Once the script is completed in vegas it writes a text file to tell the application server that vegas is currently not running any script on that machine. When a new order comes in, and the server side code verifies that vegas is currently not running the script, the js script file is overwritten with new information. The vbscript running as a scheduled task then executes the script as long as certain conditions are met. Here is the contents of the .vbs file which runs as a scheduled task. I suppose I should just close vegas at the end of the script. I was hoping that I could leave it open on my processing machines, and only have the script open a vegas if it was not open for some reason. Perhaps it may be useful to someone. Thanks for your help.

.vbs

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f, Msg
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("c:\ScriptRunning.txt", ForReading)
ScriptRunning = f.Read(1)
Set f2 = fso.OpenTextFile("c:\NewJob.txt", ForReading)
NewJob = f.Read(1)


if ScriptRunning <> "T" & NewJob <> "F" Then


'Create Shell object
Set WShell = createobject("WScript.Shell")


Set objExec = WShell.Exec("c:\Program Files\Sony\Vegas 5.0\vegas50.exe -SCRIPT:" & Chr(34) & "C:\Program Files\Sony\Vegas 5.0\Script Menu\CFTrim.js"& Chr(34))



end if
jetdv wrote on 1/4/2005, 1:39 PM
Your script needs to shut down Vegas upon completion.

If, for some reason, Vegas does not shut down, then the VBS must be able to tell it's still running after the code is written to the text file (well... maybe wait a few more seconds so it has time to shut down) and then it would have to terminate the task.

The JS script does NOT need to detect if Vegas is already running (as it's already going to be in the second instance before it COULD check).