Device Actions

Table of contents

  1. Get Device Detail
  2. Get On-Screen Content
  3. Get Orientation
  4. Lock Screen
  5. Reboot
  6. Set Airplane Mode
  7. Shut Down
  8. Toggle Airplane Mode
  9. Vibrate Device
  10. Battery
    1. Connected to Charger
    2. Get Battery Level
    3. Is Charging

To use actions in this category, use this include statement:

#include 'actions/device'

Get Device Detail

Get a detail about the current device.

enum deviceDetail {
    'Device Name',
    'Device Hostname',
    'Device Model',
    'Device Is Watch',
    'System Version',
    'Screen Width',
    'Screen Height',
    'Current Volume',
    'Current Brightness',
    'Current Appearance',
}

getDeviceDetail(deviceDetail detail)

Get On-Screen Content

Get the content currently on-screen.

getOnScreenContent()

Get Orientation

Get the current orientation of the device.

getOrientation(): text

Lock Screen

Lock the device screen.

lockScreen()

Reboot

Power off the device, then power it on again.

reboot()

Set Airplane Mode

setAirplaneMode(bool status)

Shut Down

Power off the device.

shutdown()

Toggle Airplane Mode

toggleAirplaneMode()

Vibrate Device

Vibrate the device. Only applies to Apple devices with the haptic engine.

vibrate()

Battery

Connected to Charger

Determines if the device is currently connected to a charger.

connectedToCharger(): bool

Get Battery Level

Get the current level of charge of the device battery.

getBatteryLevel()

Is Charging

Determines if the device is currently charging.

isCharging(): bool

Copyright ©. Distributed under the GPL-2.0 License. Siri Shortcuts and Mac are registered trademarks of Apple Inc. Apple is not involved in this project in any way. Do not contact Apple Support unless you are having an issue with the Shortcuts app itself.