> For the complete documentation index, see [llms.txt](https://developers.newbluefx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.newbluefx.com/captivate-api/javascript-api-reference/legacy-scheduler-methods/schedulevariables-and-schedulevariablesex-methods.md).

# scheduleVariables and scheduleVariablesEx Methods

#### `scheduleVariables` <a href="#schedulevariables" id="schedulevariables"></a>

`scheduleVariables` takes these arguments: `inputName`, `queuingMode`, `queueName`, and `variables` (where queuing mode is one of the following: `update`, `play`). Some older data controllers use this function, but since it doesn’t support sending commands to a specific title, it is less useful than `scheduleAction` and its use is therefore discouraged.

```javascript
let s = ServiceHandler.scheduler;
let inputName = 'Test: Test Actions';
s.scheduleVariables(inputName, 'play', '', { Message: 'Greetings!' });
```

#### `scheduleVariablesEx` method <a href="#schedulevariablesex-method" id="schedulevariablesex-method"></a>

This is an advanced command that can be used in place of `scheduleAction` when the action you want is complicated and/or the provided presets are not enough. See Actions List for all possible actions.

```javascript
// Called from JavaScript. Update and schedule variables with advanced controls.
ServiceHandler.scheduler?scheduleVariablesEx(action, time, inputName, channelName, queueName, titleId, startSegmentName, endSegmentName, variables);
```

* `action`: Semicolon-separated list of actions to perform in sequence.
* `time`: Ccheduler time (retrieve with `getTime()`) when animations should play (variables are updated internally immediately).
* `inputName`: Limit this action to the named input.
* `channelName`: Limit this action to the named channel.
* `queueName`: Limit this action to the named queue.
* `titleId`: Limit this action to the named title (by id).
* `startSegmentName`: Specify the starting segment by name if relevant.
* `endSegmentName`: Specify the ending segment by name if relevant.
* `variables`: JavaScript map of variable, value pairs; names must match the current definition.

**Example:**

```javascript
// This command expects time as the number of seconds since the Captivate program was launched.
// It can be left blank or set to 0 to run the action immediately.
// Remember the variables update immediately. Only the animations honor the delay.
// Therefore, the following function will do the following:
// - immediately update the variables in the preview window
// - wait 2.5 seconds before animating the variables to the program
// - wait another 2.5 seconds and then animate out
let s = ServiceHandler.scheduler;
let inputName = 'Test: Test Actions';
s.getTime((t) => {
  s.scheduleVariablesEx('animateIn', t + 2.5, inputName, '', '', '', '', '', { Message: 'Greetings!' });
  s.scheduleVariablesEx('animateOut', t + 5, inputName, '', '', '', '', '', {});
});
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.newbluefx.com/captivate-api/javascript-api-reference/legacy-scheduler-methods/schedulevariables-and-schedulevariablesex-methods.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
