Comments

SonyPJM wrote on 6/19/2007, 11:59 AM
I'm not sure exactly what you mean but you can use a shared dll from multiple scripts. This dll can reference objects in the Sony.Vegas namespace but you need to pass the Vegas objects from your little scripts to methods in the shared dll.

You'll also need an AssemblyReference element in your script config files to tell Vegas where to find your shared dll. For example, here's a sample script that uses a shared dll:


using System;
using Sony.Vegas;
using MyVegasHelpers;

public class EntryPoint {
public void FromVegas(Vegas vegas) {
VegasHelpers.PitchUp(vegas, 1);
}
}


And here is the script's config file:


<ScriptSettings>
<AssemblyReference resolver="local">MyVegasHelpers.dll</AssemblyReference>
</ScriptSettings>


In this case, MyVegasHelpers.dll is in the same directory as the script (thus the "local" resolver. You can also specify a full path to the shared dll and use the "default" resolver.


Another approach is to create links to your script in the Script Menu folder and specify script arguments in the .lnk file. Script arguments are available to the script using the static Sony.Vegas.Script.Args object:


void FromVegas(Vegas vegas) {
ScriptArgs args = Sony.Vegas.Script.Args;
}


You specify script args in your .lnk file by appending them to the end of its Target file in the properties dialog. For example:


c:\MyScripts\MyVegasUtilities.dll?method=PitchUp&amount=1
Teetow wrote on 6/19/2007, 12:17 PM
Another approach is to create links to your script in the Script Menu folder and specify script arguments in the .lnk file. Script arguments are available to the script using the static Sony.Vegas.Script.Args object:

Ah, that's the info I was looking for. You the proverbial man, Mr PJM.

---
One snub, though: the syntax

c:\MyScripts\MyVegasUtilities.dll?method=PitchUp&amount=1

Doesn't seem to be valid for .lnk files. Not a big deal, though; I'll come up with my own syntax and excavate it from the whole argument string.

---
Edit II: It's just the question mark that throws it off. If I omit that, the ScriptArgs correctly registers name/value pairs.