Knowledge Base

Knowledge Base » Scripting / API

Bulk shortcuts using Scripting and API

More than one shortcut can be sent to vMix at a time using the new scripting feature in conjunction with the API.
1. Use a programming language that has a web library that supports POST to a HTTP server. In this example we will be using WebClient in VB.NET
2. Create a list of shortcut strings to run, for example:
Function=SetText&Input=0&Value=Hello World
This example will change the text of the input in Preview before cutting it to Output
More examples can be found here:
3. The function we will be using with the API is called ScriptStartDynamic which accepts a list of shortcut strings above as the Value.
Note: This function is only available in the 4K and Pro editions.
4. The complete code example is as follows:
        Dim client As New System.Net.WebClient
        Dim commands As New System.Text.StringBuilder
        commands.AppendLine("Function=SetText&Input=0&Value=Hello World")
        Dim postValues As New System.Collections.Specialized.NameValueCollection
        postValues.Add("Function", "ScriptStartDynamic")
        postValues.Add("Value", commands.ToString)
        client.UploadValues("http://localhost:8088/API/", "POST", postValues)

Last Updated: Tuesday, 26 January 2016 1:21:33 PM