scheduleCommandXML Method

The API was originally accessed by passing XML documents around, and those endpoints are still available through the scheduleCommandXml function. For example, this is how to call readTitle.

let s = ServiceHandler.scheduler;
s.scheduleCommandXml(
  '<newblue_ext command="readTitle" channel="-1" input="API Tour: JSON Command Tester" />',
  callback
);

// or when using promises ...
await ServiceHandler.commandXml(
  '<newblue_ext command="readTitle" channel="-1" input="API Tour: JSON Command Tester" />'
);

// is equivalent to this:
s.scheduleCommand('readTitle', { channel: -1, input: 'API Tour: JSON Command Tester' }, {}, callback);

Notice how all parameters are passed as attributes on one root node named newblue_ext;

Captivate will respond by passing the following XML to the callback function:

<newblue_ext command="readTitle" reply="readTitle" success="1">
    <title position="4" ready="1" name="Carbon Basketball Scoreboard" input="Shared: Objects,API Tour: JSON Command Tester" id="{05930c36-bd6d-4350-80cd-f58b476fbde9}" function="" inputActive="1" selected="0">
        <running time="111.6" playInStart="0" playInEnd="0" playOutStart="0" playOutEnd="0" playHead="0" playState="Off" />
        <variables>
            <variable name="Clock 1" value="00:00" varType="128" dataType="text" dynamic="1" input="" show="1" />
            <variable name="Clock 2" value="0" varType="128" dataType="text" dynamic="1" input="" show="1" />
            <variable name="Home Score" value="0" varType="128" dataType="text" dynamic="1" input="" show="1" />
            <variable name="Home Short Name" value="HOME" varType="128" dataType="text" dynamic="1" input="" show="1" />
            <variable name="Home Timeouts" value="" varType="128" dataType="text" dynamic="1" input="" show="1" />
            <variable name="Period" value="1" varType="128" dataType="text" dynamic="1" input="" show="1" />
            <variable name="Visitor Score" value="0" varType="128" dataType="text" dynamic="1" input="" show="1" />
            <variable name="Visitor Short Name" value="VSTR" varType="128" dataType="text" dynamic="1" input="" show="1" />
            <variable name="Visitor Timeouts" value="" varType="128" dataType="text" dynamic="1" input="" show="1" />
            <variable name="Home Poss." value="1" varType="128" dataType="visible" dynamic="1" input="" show="1" />
            <variable name="Message" value="1" varType="128" dataType="visible" dynamic="1" input="" show="1" />
            <variable name="Visitor Poss." value="1" varType="128" dataType="visible" dynamic="1" input="" show="1" />
            <variable name="Home Logo" value="/Library/Application Support/NewBlue/Titler Content/Resources/Library/Project Templates/Sports/Carbon/textures/Placeholder-A.png\\\0" varType="128" dataType="style-texture.texture" dynamic="1" input="" show="1" />
            <variable name="Visitor Logo" value="/Library/Application Support/NewBlue/Titler Content/Resources/Library/Project Templates/Sports/Carbon/textures/Placeholder-B.png\\\0" varType="128" dataType="style-texture.texture" dynamic="1" input="" show="1" />
            <variable name="Duration" value="1.502" varType="128" dataType="duration" dynamic="1" input="" show="0" />
            <variable name="Home Color" value="#ff1e1e1e" varType="0" dataType="style-texture.color" dynamic="0" input="" />
            <variable name="Visitor Color" value="#ff2065ab" varType="0" dataType="style-texture.color" dynamic="0" input="" />
            <variable name="Position" value="0,0" varType="0" dataType="position" dynamic="0" input="" />
            <variable name="Scale" value="1,1" varType="0" dataType="scale" dynamic="0" input="" />
        </variables>
    </title>
</newblue_ext>

Notice that the reported inputName has all connected inputs separated by a comma.

Last updated