Device
Provides information about the device.
Reads information about the current device and its screen.
Methods
Section titled “Methods”batteryLevel()
Section titled “batteryLevel()”Current battery level.
static batteryLevel(): numberThe value is in percentage ranging between 0 and 1.
Return value
Section titled “Return value”number
isCharging()
Section titled “isCharging()”Whether the device is being charged.
static isCharging(): boolReturn value
Section titled “Return value”bool
isDischarging()
Section titled “isDischarging()”Whether the device is being not plugged into power and thus discharging.
static isDischarging(): boolReturn value
Section titled “Return value”bool
isFaceDown()
Section titled “isFaceDown()”Whether the device is lying parallel to the ground with the screen facing downwards.
static isFaceDown(): boolReturn value
Section titled “Return value”bool
isFaceUp()
Section titled “isFaceUp()”Whether the device is lying parallel to the ground with the screen facing upwards.
static isFaceUp(): boolReturn value
Section titled “Return value”bool
isFullyCharged()
Section titled “isFullyCharged()”Whether the device is fully charged.
static isFullyCharged(): boolReturn value
Section titled “Return value”bool
isInLandscapeLeft()
Section titled “isInLandscapeLeft()”Whether the device is in landscape with the home button or home indicator on the right side.
static isInLandscapeLeft(): boolReturn value
Section titled “Return value”bool
isInLandscapeRight()
Section titled “isInLandscapeRight()”Whether the device is in landscape with the home button or home indicator on the left side.
static isInLandscapeRight(): boolReturn value
Section titled “Return value”bool
isInPortrait()
Section titled “isInPortrait()”Whether the device is in portrait with the home button or home indicator at the bottom.
static isInPortrait(): boolReturn value
Section titled “Return value”bool
isInPortraitUpsideDown()
Section titled “isInPortraitUpsideDown()”Whether the device is in portrait but upside down with the home button or home indicator at the top.
static isInPortraitUpsideDown(): boolReturn value
Section titled “Return value”bool
isPad()
Section titled “isPad()”Whether the device is a pad.
static isPad(): boolYou can use this property to choose behavior of a script depending on whether its running on a phone or a pad.
Return value
Section titled “Return value”bool
isPhone()
Section titled “isPhone()”Whether the device is a phone.
static isPhone(): boolYou can use this property to choose behavior of a script depending on whether its running on a phone or a pad.
Return value
Section titled “Return value”bool
isUsingDarkAppearance()
Section titled “isUsingDarkAppearance()”Whether the device is using dark appearance.
static isUsingDarkAppearance(): boolWhen running in the app, this reflects Scriptable’s current appearance, including the theme in Settings.
This API is not supported in widgets.
Return value
Section titled “Return value”bool
language()
Section titled “language()”Identifier for the device language.
static language(): stringReturn value
Section titled “Return value”string
locale()
Section titled “locale()”Identifier for the device locale.
static locale(): stringReturn value
Section titled “Return value”string
model()
Section titled “model()”Model of the device, e.g. “iPhone”.
static model(): stringReturn value
Section titled “Return value”string
name()
Section titled “name()”Name identifying the device.
static name(): stringYou can find and edit the name of your device in the system settings.
Return value
Section titled “Return value”string
preferredLanguages()
Section titled “preferredLanguages()”The preferred langauges.
static preferredLanguages(): [string]The list is ordered according to the language preferences specified in the system settings.
Return value
Section titled “Return value”[string]
screenBrightness()
Section titled “screenBrightness()”Brightness of the screen in percentage.
static screenBrightness(): numberThe value range from 0 to 1. To set the screen brightness, refer to the setScreenBrightness() function.
Return value
Section titled “Return value”number
screenResolution()
Section titled “screenResolution()”Resolution of the screen.
static screenResolution(): SizeThe value is measured in pixels. The value does not take the rotation of the deviec into account.
Return value
Section titled “Return value”Size
screenScale()
Section titled “screenScale()”Scale of the screen.
static screenScale(): numberStandard 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.
Return value
Section titled “Return value”number
screenSize()
Section titled “screenSize()”Size of the screen.
static screenSize(): SizeThe 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.
Return value
Section titled “Return value”Size
setScreenBrightness(percentage)
Section titled “setScreenBrightness(percentage)”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.
Parameters
Section titled “Parameters”percentage number
Percentage to set the screen brightness to. Value between 0 and 1.
systemName()
Section titled “systemName()”Name of the operating system:
static systemName(): stringReturn value
Section titled “Return value”string
systemVersion()
Section titled “systemVersion()”Version of the operating system.
static systemVersion(): stringReturn value
Section titled “Return value”string
volume()
Section titled “volume()”The device volume.
static volume(): numberThe value range from 0 to 1.
Return value
Section titled “Return value”number