vMix Scripting supports the powerful and easy to understand VB.NET language when writing your script.
Hello World Example
Consider the following vMix take on the infamous "Hello World" application:
Input.Find("NewsHD.xaml").Text("Headline") = "Hello World!"
Or put another way:
dim i = Input.Find("NewsHD.xaml")
i.Text("Headline") = "Hello World!"
Both of these scripts do the same thing, that is to find the Title Input with name "NewsHD.xaml" and assign the "Headline" field with the text "Hello World!"
To try it out add the NewsHD.xaml title template to vMix and then run the script.
vMix Scripting supports the majority of VB.NET 2.0 code that will work within a single sub or function.
This means that custom classes and structures are not supported, however you can use the vast majority of the built in base classes in the .NET framework
including the handy System.Net.WebClient for downloading data over the internet.
There are a number of built in objects that can be used from within vMix scripting:
Output As Input
Preview As Input
Find(inputNameNumberOrKey as String) As Input
Text(Optional fieldName As String = "") As String
Change the text of a Field within an Title input, or read the current value
Function(functionName As String, Optional value As String = "", Optional duration As Integer = 0, Optional selectedName As String = "", Optional selectedIndex As Integer = 0)
Function can be used to call any Shortcut function in vMix
WaitForCompletion(timeoutMilliseconds As Integer) As Boolean
Wait for a video to finish playing and return True, otherwise return False if timed out.
Find(number as Integer) As Overlay
In(input as String)
For i As Integer = 1 to 4
WriteLine(message as String)
Write the message string to the vMix Script console accessible from the Scripting tab of Settings.
This is useful for debugging purposes
Console.WriteLine("Beginning Example Script")
Console.WriteLine("Title should now appear in Overlay 1, now we wait 5 seconds")
Console.WriteLine("Now we will transition out Overlay 1")
XML() As String
Returns the XML state of vMix as per the vMix Web API
Function(functionName As String, Optional input As String = "", Optional value As String = "", Optional duration As Integer = 0, Optional selectedName As String = "", Optional selectedIndex As Integer = 0)
Calls an API function as per the vMix Web API