Connector helpers
These helpers fire, list and stop the connectors in the project, and send commands to the Batch Processor. For what a connector is and how to set one up, see Connectors in the User Guide.
| Function | Returns | Description |
|---|---|---|
TriggerConnectorByName(name: string) |
bool |
Fires the named Web API connector by issuing a fire-and-forget HTTP GET to the local connector trigger endpoint. Returns false if the HTTP API is disabled in settings or the connector does not exist. |
ListConnectors() |
string (JSON) |
Returns every connector as a JSON array, in the same shape as /api/connector/list — each entry carries Id, Name, Group, IsActive, IsRunning, TimerMs, InvokeCount and Description. Parse it with JSON.parse in script. |
ListRunningConnectors() |
string (JSON) |
Returns only the connectors that are currently running, as a JSON array in the same shape as ListConnectors. A connector counts as running while one of its API commands is still animating or waiting out its delay. |
StopConnectorsByGroup(group: string) |
int |
Stops every running connector in the given group, matched case-insensitively. Returns the number actually stopped. A blank group stops nothing — ungrouped connectors are never swept. |
StopConnectorById(id: string) |
bool |
Stops the connector with the given id. Returns false, and logs an error, when the id is not a valid GUID or no connector carries it. |
StopConnectorByName(name: string) |
bool |
Stops the connector with the given name, matched case-insensitively. Returns false, and logs an error, when no connector has that name or when several do — an ambiguous name is refused rather than resolved arbitrarily, so use StopConnectorById for duplicates. |
CallBatchCommand(command: string, batchName: string) |
bool |
Enqueues a Batch Processor command for the named batch via the HTTP API batch handler. command must be one of the BatchCommand values — "SHOWLAYER", "HIDELAYER", or "SHOWLAYERSOLO" (case-insensitive). batchName is matched against each layer's Batch tag using the default Contains comparison, across every scene in the project. For scene-scoped or stricter-comparison invocations, drive the Batch Processor input's properties directly via SetPropertyById + ExecuteCommandById. Always returns true; check the application log for queue-rejection details. |
StopAllConnectors() |
int |
Stops every running connector. Returns how many were actually stopped, which is the number that were running — Stop is a no-op on an idle connector. |
Stopping connectors, and connector groups
A connector is running while one of its API commands is still animating or waiting out its delay — an instant command finishes before the call returns and never shows as running. Stopping one freezes an in-flight animation where it stands rather than jumping it to its end value, and drops the commands that were still queued behind a delay.
Each connector has a Group. Connectors sharing a group are mutually exclusive when the
ConnectorRestrictions setting is StopRunningConnectorsInSameGroup: invoking one stops the others in
that group and leaves everything else alone. A connector whose Group is empty is ungrouped — it neither
stops others nor is stopped by them, so a project that sets no groups behaves exactly as it did before.
// What is running right now?
const running = JSON.parse(Project.ListRunningConnectors());
running.forEach(c => log(c.Name + " has been running for " + c.TimerMs + " ms"));
// Clear one group before rolling the next item in it.
Project.StopConnectorsByGroup("LowerThirds");
Project.TriggerConnectorByName("LowerThirdGuest");
// Stop a single connector. Prefer the id when names may repeat — StopConnectorByName
// refuses an ambiguous name rather than picking one arbitrarily.
Project.StopConnectorByName("RollSting");
// Panic button.
const stopped = Project.StopAllConnectors();
log("Stopped " + stopped + " connectors");
Group names are matched without regard to case, so "Stings" and "stings" are one group. They are not
trimmed, so " Stings " is a different group from "Stings" — what you type in the field is what is
matched.