# Display and UI

These global variables provide information about the display, window, and UI state of the OSL environment.

## Window and Focus Variables

| Variable                 | Type    | Description                               |
| ------------------------ | ------- | ----------------------------------------- |
| `focused_application`    | String  | Name of the currently focused application |
| `focused_application_id` | Number  | ID of the currently focused application   |
| `is_origin_focused`      | Boolean | Whether the Origin environment has focus  |
| `window_top_index`       | Number  | Z-index of the topmost window             |

## Badges

| Variable | Type   | Description                                                          |
| -------- | ------ | -------------------------------------------------------------------- |
| `badges` | Object | A list of all currently accessible badges, along with their icn code |

## Examples

```javascript
// Check if application has focus
if is_origin_focused (
  log "Origin has focus"
)

// Display current application
log "Current application: " ++ focused_application + " (ID: " ++ focused_application_id ++ ")"
```


---

# 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/global-variables/display-ui.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.
