Script cue API

A script cue runs JavaScript on its own worker thread when the cue fires, and holds the show until it finishes.

How it runs

Trust

A workspace file is executable code and network-triggerable: a script cue runs a system command as you when it fires, and a network trigger (OSC, MIDI or show control) lets one packet on the show network fire any cue, scripts included. Only open .cuerunner files you trust, and only on a network you trust — the composition is the risk, not either half alone. OSC input listens on all interfaces by default.

shell(command, options?)

Runs a system command and resolves with its result.

const r = await shell('echo dimmer 80%') console.log(r.stdout.trim())
ResolvesOptions
{ stdout, stderr, code, signal } timeout (ms, default 10000), cwd, env

Commands start in the workspace's folder.

include('path/to/file.js')

Runs another JavaScript file and resolves with whatever that file returned, so a helper file can hand back values. Each file runs once per cue however many times it is included, and an include inside a file resolves relative to that file.

const rig = await include('lib/rig.js') await rig.blackout()

Where the output goes

The run log. In a packaged build there is no developer console, so the Log tab is the only place to read what a script printed. Running from source, the same lines also appear in the terminal as [renderer] ….