Can you be more specific? Capturing the output is done by VoiceAttack itself, so there's little improvement to be made there.
Are you trying to display the output somewhere so you can read it, or does it need to be passed to another application for further processing?
In case of the former, you could output the contents of STDOUT to VoiceAttack's log using an inline C# function:
using System;
public class VAInline
{
public void main()
{
string[] STDOUT = VA.GetText("~STDOUT").Split(new[] {Environment.NewLine}, StringSplitOptions.None);
Array.Reverse(STDOUT);
foreach( string i in STDOUT)
{
VA.WriteToLog(i,"");
}
}
}
Note that it's looking for a variable named "~STDOUT"; The "~" prefix means the variable value will be discarded(it'll return "Not Set") after the command is finished executing.
If you have the VoiceAttack log set to "New entries at bottom", you'll want to remove the "Array.Reverse(STDOUT);" line.
If you anticipate the application not printing anything to the console, you'll want to add a check for that:
using System;
public class VAInline
{
public void main()
{
string STDOUT = VA.GetText("~STDOUT");
if (String.IsNullOrWhiteSpace(STDOUT))
{
VA.WriteToLog("STDOUT is blank","red");
return;
}
string[] STDOUTlines = STDOUT.Split(new[] {Environment.NewLine}, StringSplitOptions.None);
Array.Reverse(STDOUTlines);
foreach( string line in STDOUTlines)
{
VA.WriteToLog(line,"");
}
}
}
If you don't mind using external files, you could just create a batch file that runs your application, followed by a pause instruction so the console window stays open.
E.G.
start "" "C:\MyApplication"
pause