The changes I made to the included “Batch Render.cc” are included below:
foreach (Sony.Vegas.Region region in myVegas.Project.Regions) {
// need to strip off the extension’s leading “*”
String regionFilename = String.Format(“{1}{2}”,
region.Label,
renderItem.Renderer.FileExtension.Substring(1));
// Render the region
The following error occurs after I execute the script and choose a format and pick a location.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at EntryPoint.DoBatchRender(ArrayList selectedTemplates, String basePath, RenderMode renderMode)
at EntryPoint.FromVegas(Vegas vegas)
— End of inner exception stack trace —
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sony.Vegas.ScriptHost.ScriptManager.Run(Assembly asm, String className, String methodName)
at Sony.Vegas.ScriptHost.CodeDomScriptManager.Run()
at Sony.Vegas.ScriptHost.RunScript(Boolean fCompileOnly)