App

Application class.

Modulerequire("gui")
TypeClass

This class represents current app and provides app wide APIs.

This class can not be created by user, you can only receive its global instance from the app property of the module:

gui.app.getApplicationMenu()

Methods

setApplicationMenu(menu) macOS

Set the application menu bar.

Parameters

getApplicationMenu() macOS

Return the application menu bar.

Return

MenuBar

setDockBadgeLabel(label) macOS

Set the label to be displayed in dock’s badging area.

Parameters

getDockBadgeLabel() macOS

Get the label displayed in dock’s badging area.

Return

String

activate(force) macOS

Make current app the active app.

The force parameter is normally set to false. When the Finder launches an app, using a value of false for force allows the app to become active if the user waits for it to launch, but the app remains unobtrusive if the user activates another app. Regardless of the setting of flag, there may be a time lag before the app activates—you should not assume the app will be active immediately after sending this message.

Parameters

deactivate() macOS

Deactivate current app.

isActive() macOS

Return whether current app is the active app.

Return

Boolean

setActivationPolicy(policy) macOS

Modify the app's activation policy.

Parameters

getActivationPolicy() macOS

Return app's activation policy.

Return

App::ActivationPolicy