# Applications

Interact with and track external applications running on the host system.

{% hint style="warning" %}
This module must be enabled under "Plugins" in the Deskifier Dashboard\
\
**This module isn't supported on Linux builds & MAS (Mac App Store) builds.**
{% endhint %}

## Methods

### <mark style="color:purple;">Bring External Application To Top</mark>

Brings an external application to the top and sets it as the focus.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.applications.bringToTop({ arguments })
```

**Arguments**

* `id` <mark style="color:green;">Number</mark> (Required)\
  The ID of the application

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Restore External Application</mark>

Restores an external application from a hidden state.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.applications.restore({ arguments })
```

**Arguments**

* `id` <mark style="color:green;">Number</mark> (Required)\
  The ID of the application

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Minimize External Application</mark>

Hides an external application's window.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.applications.minimize({ arguments })
```

**Arguments**

* `id` <mark style="color:green;">Number</mark> (Required)\
  The ID of the application

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Maximize External Application</mark>

Maximizes an external application.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.applications.maximize({ arguments })
```

**Arguments**

* `id` <mark style="color:green;">Number</mark> (Required)\
  The ID of the application

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Set External Application Bounds</mark>

{% hint style="warning" %}
Requires accessibility permission on ***macOS***
{% endhint %}

Sets the position and size of an external application's window.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.applications.setBounds({ arguments })
```

**Arguments**

* `id` <mark style="color:green;">Number</mark> (Required)\
  The ID of the application
* `x` <mark style="color:green;">Number</mark> (Optional)\
  The X offset.
* `y` <mark style="color:green;">Number</mark> (Optional)\
  The Y offset.
* `width` <mark style="color:green;">Number</mark> (Optional)\
  The width of the external application.
* `height` <mark style="color:green;">Number</mark> (Optional)\
  The height of the external application.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Overlay</mark>

Starts an overlay window that follows an external application or the active focus.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.applications.overlay({ arguments })
```

**Arguments**

* `applicationId` <mark style="color:green;">Number</mark> (Optional)\
  The ID of the application to overlay. If omitted, the overlay follows focus.
* `windowId` <mark style="color:green;">String</mark> (Optional)\
  A specific window ID to target.
* `refreshInterval` <mark style="color:green;">Number</mark> (Optional)\
  How often (in ms) the overlay position refreshes while the target is active.
* `idleRefreshInterval` <mark style="color:green;">Number</mark> (Optional)\
  How often (in ms) the overlay position refreshes while the target is idle.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
* `windowId` <mark style="color:green;">String</mark>\
  The ID of the overlay window.
* `applicationId` <mark style="color:green;">Number</mark>\
  The ID of the application being overlaid, or `null` if following focus.
* `followsFocus` <mark style="color:green;">Boolean</mark>\
  Whether the overlay follows the active focus.
* `refreshInterval` <mark style="color:green;">Number</mark>
* `idleRefreshInterval` <mark style="color:green;">Number</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Stop Overlay</mark>

Stops an active overlay window.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.applications.stopOverlay({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  The ID of the overlay window to stop. If omitted, stops the current overlay.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

## Properties

### <mark style="color:purple;">Get Active Application</mark>

Returns the current active (focused) application details.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.applications.getActive()
```

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
* `applicationDetails` [<mark style="color:blue;">Deskifier.applicationDetails</mark>](#applicationdetails)
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Get Applications</mark>

Returns applications currently running on the device.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.applications.getAll()
```

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
* `applicationDetails` Array Of [<mark style="color:blue;">Deskifier.applicationDetails</mark>](#applicationdetails)
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Get Tracked Overlays</mark>

Returns all currently active overlay windows.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.applications.getTrackedOverlays()
```

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
* `overlays` <mark style="color:blue;">Array of</mark> overlay objects.
  {% endtab %}
  {% endtabs %}

***

## Events

### <mark style="color:purple;">External Application Activated</mark>

Fires when a user switches applications.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.applications.onExternalActivated((data) => { })
```

**Arguments**

* `activeApplication` [<mark style="color:blue;">Deskifier.applicationDetails</mark>](#applicationdetails)
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Overlay Started</mark>

Fires when an overlay window starts tracking an application.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.applications.onOverlayStarted((data) => { })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
* `applicationId` <mark style="color:green;">Number</mark> — `null` if following focus.
* `followsFocus` <mark style="color:green;">Boolean</mark>
* `refreshInterval` <mark style="color:green;">Number</mark>
* `idleRefreshInterval` <mark style="color:green;">Number</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Overlay Stopped</mark>

Fires when an overlay window stops tracking.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.applications.onOverlayStopped((data) => { })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
* `reason` <mark style="color:green;">String</mark>\
  Why the overlay stopped. One of: `manual`, `replaced`, `window-destroyed`, `target-gone`.
  {% endtab %}
  {% endtabs %}

***

## *Objects*

### *<mark style="color:purple;">applicationDetails</mark>*

* `id` <mark style="color:green;">Number</mark>\
  The ID of the application.
* `title` <mark style="color:green;">String</mark>\
  The application title.
* `processId` <mark style="color:green;">Number</mark>
* `path` <mark style="color:green;">String</mark>\
  The application executable path.
* `bounds` <mark style="color:green;">Object</mark> (Optional)
  * `width` <mark style="color:green;">Number</mark>\
    The application's window width.
  * `height` <mark style="color:green;">Number</mark>\
    The application's window height.
  * `x` <mark style="color:green;">Number</mark>\
    The application's window X offset.
  * `y` <mark style="color:green;">Number</mark>\
    The application's window Y offset.
* `isVisible` <mark style="color:green;">Boolean</mark> (Optional)\
  If the application is currently visible (Note, this isn't always fully accurate).
* `isWindow` <mark style="color:green;">Boolean</mark> (Optional)\
  If the application has an interactive window (Note, this isn't always fully accurate).
* `zOrder` <mark style="color:green;">Number</mark> (Optional)\
  The application's Z-order position in the window stack.
* `icon` <mark style="color:green;">String</mark> (Optional)\
  Base64-encoded icon image for the application, or `null` if unavailable.


---

# 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://deskifier.gitbook.io/deskifier/applications.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.
