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. Show Control Center
  11. Battery
    1. Connected to Charger
    2. Get Battery Level
    3. Is Charging
  12. Screen Time
    1. Get Website & App Activity

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

#include 'actions/device'

Get Device Detail

Get a detail about 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()

Only supported on iOS/iPadOS.

Show Control Center

Open the control center on the device.

showControlCenter()

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

Screen Time

Get Website & App Activity

enum deviceUsageType {
    'all',
    'app',
    'website',
}

enum usageDuration {
    'today',
    'yesterday',
    'lastWeek',
    'thisWeek',
    'thisMonth',
    'thisYear',
    'specifiedDay',
    'inBetween',
}

getDeviceUsage(deviceUsageType ?usageType = "all", variable ?device, usageDuration ?during = "today", text ?startTime, text ?startTime)

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.