accessAppWindow
Searches for an active window belonging to an original AC app,
a Python app, or a Lua app.
It returns an ac.AppWindowAccessor object used to control the window’s visibility, position, and rendering behavior.
Usage Patterns
Section titled “Usage Patterns”Find a window by its display name.
local chat = ac.accessAppWindow("Chat")Description
Section titled “Description”The ac.accessAppWindow function acts as a bridge between your script and other apps running in the simulation.
This is particularly good for creating custom HUD layouts or utility tools that manage the user’s workspace.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
windowName | string | Yes | The exact name of the window as defined in its source. |
Return Values
Section titled “Return Values”| Type | Description |
|---|---|
ac.AppWindowAccessor | An object providing methods to control the window. Returns nil if not found. |
Examples
Section titled “Examples”Finding the official ‘Chat’ app and ensuring it is hidden.
local chatWindow = ac.accessAppWindow("Chat")
if chatWindow and chatWindow:valid() then chatWindow:setVisible(false)endMoving a specific app window to a fixed coordinate on the screen.
local telemetry = ac.accessAppWindow("Telemetry")
if telemetry and telemetry:valid() then -- move to top-left corner telemetry:move(vec2(10, 10))end