Comments

jetdv wrote on 4/22/2003, 8:33 PM
My best answers are yes, no, and no.

added to 4b: * Added new command-line switch for Vegas: -SCRIPT:<script-name> (runs
the specified script).
SonyPJM wrote on 4/23/2003, 9:48 AM

jetdv is pretty much right:

1) you can start vegas from the command line like so:

vegas40.exe -SCRIPT:<full-path-to-script-file>

You can also send a running instance of Vegas messages that instruct
it to run a script.

2) Parameters cannot be passed to a script in the same way you might
pass parameters to a command-line app but you can work around it by
sticking parameters in a known location, such as the script's
configuration XML file or the registry.

3) Vegas itself does not have a run-as-service mode but you could
possibly write a service that manages Vegas and sends it script
messages.
bas wrote on 4/23/2003, 12:19 PM
I get the following error when trying to initiate the script:

"An invalid argument was specified"

I am running Vegas4.0 (build 115)

command issued:
cd <dir containing exe>
vegas40.exe -SCRIPT:c:\test3.js

I also tried putting the script in the same directory as the .exe but got the same results. I verified the script runs properly by invokeing it via the GUI.
SonyPJM wrote on 4/23/2003, 12:42 PM
That feature was introduced in 4.0b... you can download the update from our web site.
bas wrote on 4/23/2003, 3:05 PM
I downloaded 4.0b. It allows me to run a script from the command line. However, every time I run a script I get another instance of the GUI. Is there a way in the script to close the GUI?

thanks,
bas
SonyPJM wrote on 4/23/2003, 3:42 PM
I'm afraid not... I'll see if I can add a quit command in the next release.
bas wrote on 4/29/2003, 12:35 PM
I've created a script that separates the left and right audio channels from an audio track and then creates a file for each channel. When the script is run from the GUI it works (sort of - the second channel is not rendered properly - no audio). However, when I run the same script from the command line it does not render the files correctly. The GUI indicates it is rendering the track. The files are created and are the corrct length but there is no audio.

Any idea whet is going on?

bas
SonyPJM wrote on 4/29/2003, 3:39 PM
I've reproduced this bug. There should be a fix in the upcoming release.
bas wrote on 4/29/2003, 5:11 PM
In addition to writing a script that separates two channels into two distinct files, I am trying to write a script that does just the opposite, taking two distinct files and rendering them as one. From the GUI I am able to accomplish this. However, from a script I cannot find out how to pan 100% L on one file (track)and 100% R on the other. Currently my result is two channels in one file (track) but both channels are the same. Is it possible to accomplish this feature using scripting?

bas
SonyPJM wrote on 4/30/2003, 12:18 PM

Have you tried adding Pan envelopes to your audio tracks?


var pan1 = new Envelope(EnvelopeType.Pan);
audioTrack1.Envelopes.Add(pan1);
var pan2 = new Envelope(EnvelopeType.Pan);
audioTrack2.Envelopes.Add(pan2);
pan1.Points[0].Y = 1; // pan 100% right
pan2.Points[0].Y = -1; // pan 100% left

bas wrote on 5/12/2003, 5:54 PM
With the new 4.0c version when I call the Vegas.Exit() method, a message box appears asking if I want to save. The project was created with Vegas.NewProject(false,false). Since this script is being run from the command line by another porgram, no response is possible. Has the project been created wrong or is this feature not available?

thanks,
bas
SonyPJM wrote on 5/13/2003, 8:53 AM
Before you call Vegas.Quit(), call Vegas.SaveProject(fileName)... taht way the "Do you want to save" dialog will not appear since the project has no pending modifications.
bas wrote on 5/13/2003, 12:28 PM
I tried the SaveProject() and SaveProject(filename). It still pops up a message box asking if the project should be saved (it does contain the name of the filename entered in the SaveProject() method).

bas
SonyPJM wrote on 5/13/2003, 4:30 PM

I'm afraid this is a bug. You can work around it by first calling
Vegas.SaveProject(), then Vegas.NewProject(false, false), then
Vegas.Quit().

Sorry for the inconvenience.
bas wrote on 5/13/2003, 5:06 PM
I tried the workaround with slight modifications (filename in SaveProject() to prevent asking of filename to save and Vegas.Exit() instead of Vegas.Quit())


The following message appears:
A background operation is currently in progress.
Vegas cannot shutdown until this operation is complete or cancelled.
Would you like to cancel this operation?

The only changes to the script were the recommend 3 lines. Without the 3 lines the script works correctly except for a message box asking to save files. The script exits properly when the message box is responded to.

thanks for your help.

bas
mescribano wrote on 5/14/2003, 3:59 AM
How can we send a running instance of Vegas messages that instruct
it to run a script?

jetdv wrote on 5/14/2003, 8:57 AM
Like this:

* Scripts can now be run by sending Vegas a WM_COPYDATA message.


According to:

http://www.sonicfoundry.com/forums/ShowMessage.asp?MessageID=172785&Replies=1&Page=2
SonyPJM wrote on 5/14/2003, 9:26 AM

True, the basic idea is to send Vegas a WM_COPYDATA message but there
are more details involved (finding Vegas's hwnd, the contents of the
COPYDATASTRUCT, etc.). To illustrate these details, I have posted a
sample C# application that remotely controls Vegas.

You can download the source archive here.
roger_74 wrote on 5/14/2003, 10:21 AM
Looks like the file is corrupt, I can't unzip it.
SonyPJM wrote on 5/14/2003, 10:28 AM
Should be OK now... I forgot to xfer in binary mode.
roger_74 wrote on 5/14/2003, 10:32 AM
Thanks. And thanks for the sample.
mescribano wrote on 5/14/2003, 11:29 AM
Thank very much. Suggestion: maybe it would also be handy to send the whole script in the WM_COPYDATA message instead of the script path, thus the script file does not need to exist at all...
bas wrote on 5/19/2003, 1:56 PM
I finnally got my script to work from the command line. The script takes a .wmv file and splits the left and right audio channels into separate .wav files. However, when I try and run the script with slight modifications to work with .mpg files it doesn't work. It creates a left and a right .mpa file. The mpa file plays fine in Vegas. However, no other player can play the mpa file.

Any ideas?

thanks,
bas