Skip to content

Device

Provides information about the device.

Reads information about the current device and its screen.

Current battery level.

static batteryLevel(): number

The value is in percentage ranging between 0 and 1.

number

Whether the device is being charged.

static isCharging(): bool

bool

Whether the device is being not plugged into power and thus discharging.

static isDischarging(): bool

bool

Whether the device is lying parallel to the ground with the screen facing downwards.

static isFaceDown(): bool

bool

Whether the device is lying parallel to the ground with the screen facing upwards.

static isFaceUp(): bool

bool

Whether the device is fully charged.

static isFullyCharged(): bool

bool

Whether the device is in landscape with the home button or home indicator on the right side.

static isInLandscapeLeft(): bool

bool

Whether the device is in landscape with the home button or home indicator on the left side.

static isInLandscapeRight(): bool

bool

Whether the device is in portrait with the home button or home indicator at the bottom.

static isInPortrait(): bool

bool

Whether the device is in portrait but upside down with the home button or home indicator at the top.

static isInPortraitUpsideDown(): bool

bool

Whether the device is a pad.

static isPad(): bool

You can use this property to choose behavior of a script depending on whether its running on a phone or a pad.

bool

Whether the device is a phone.

static isPhone(): bool

You can use this property to choose behavior of a script depending on whether its running on a phone or a pad.

bool

Whether the device is using dark appearance.

static isUsingDarkAppearance(): bool

When running in the app, this reflects Scriptable’s current appearance, including the theme in Settings.

This API is not supported in widgets.

bool

Identifier for the device language.

static language(): string

string

Identifier for the device locale.

static locale(): string

string

Model of the device, e.g. “iPhone”.

static model(): string

string

Name identifying the device.

static name(): string

You can find and edit the name of your device in the system settings.

string

The preferred langauges.

static preferredLanguages(): [string]

The list is ordered according to the language preferences specified in the system settings.

[string]

Brightness of the screen in percentage.

static screenBrightness(): number

The value range from 0 to 1. To set the screen brightness, refer to the setScreenBrightness() function.

number

Resolution of the screen.

static screenResolution(): Size

The value is measured in pixels. The value does not take the rotation of the deviec into account.

Size

Scale of the screen.

static screenScale(): number

Standard resolution displays have a scale of 1.0 where one point on the screen equals one pixel. Retina displays will have a scale factor of 2.0 or 3.0 where one point on the screen is four or nine pixels, respectively.

number

Size of the screen.

static screenSize(): Size

The value is measured in points. For an explanation of the relationship between points and pixels, see the documentation of the screenScale() method. The value takes the device rotation into account, so the value will vary between portrait and landscape.

Size

Sets the brightness of the screen.

static setScreenBrightness(percentage: number)

The value range from 0 to 1. To get the screen brightness, refer to the screenBrightness() function.

percentage number

Percentage to set the screen brightness to. Value between 0 and 1.

Name of the operating system:

static systemName(): string

string

Version of the operating system.

static systemVersion(): string

string

The device volume.

static volume(): number

The value range from 0 to 1.

number