# Send Data Between Windows

## Send data to a window

```js
transmit data window_id
// send data to a window
```

## Handle receiving data

You will want something like what is below inside of your mainloop to handle all incoming transmit

```js
if new_transmit (
  // theres new data to handle
  
  log transmit_source
  // log the id of the window that sent you data
  // (normally so you can respond or verify that its allowed to transmit to you)
  
  log transmit_data
  // log the data from the transmit
  
  new_transmit = false
  // reset the flag (very important)
)
```

## Possibly helpful info

Check out the parents and children section for useful information: [Broken mention](broken://pages/cmz8bxQBQllOgjBjNCli#parents-and-children)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://osl.mistium.com/environment/send-data-between-windows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
