Skip to content

IConsole Interface

Console interface for scripts. Use this interface to run new scripts or print output from scripts to the console window.

Methods

Method Returns Description
WriteLine(string line) void Write a line of text to the console window
Write(string line) void Write text to the console window (no newline)
Clear() void Clear the console window from any text
RunScript(string script, string arguments) void Load, compile and run a script with arguments
RunScript(string script) void Load, compile and run a script without arguments
GetScriptFolder() string Return the folder of the last run script

Example

IConsole console = scripting.GetConsole();

// Clear previous output
console.Clear();

// Write output
console.WriteLine("Processing videos...");
console.Write("Progress: ");
console.WriteLine("50%");

// Run another script
string scriptPath = console.GetScriptFolder() + "\\helper.cs";
console.RunScript(scriptPath, "arg1 arg2");

See Also