macOS Only Actions

Table of contents

  1. Get Apps
  2. Make Disk Image
  3. Make Sized Disk Image
  4. Take Interactive Screenshot
  5. Device
    1. Display Sleep
    2. Sleep
    3. Start Screensaver
  6. Scripts
    1. Run Apple Script
    2. Run JavaScript for Automation
    3. Run Shell Script
  7. Windows
    1. Get Windows
    2. Move Window
    3. Resize Window

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

#include 'actions/mac'

Get Apps

Get list of applications.

getApps(): array

Only supported on macOS.


Make Disk Image

Create a new disk image.

makeDiskImage(text name, variable contents, bool ?encrypt = false)

Only supported on macOS.


Make Sized Disk Image

Create a new disk image of a specific size.

enum storageUnit {
    'bytes',
    'KB',
    'MB',
    'GB',
    'TB',
    'PB',
    'EB',
    'ZB',
    'Y',
}

makeSizedDiskImage(text name, variable contents, #storageUnit (qty)?diskSize = qty(1, "GB"), bool ?encrypt = false)

Only supported on macOS.


Take Interactive Screenshot

enum screenshotSelection {
    'Window',
    'Custom',
}

takeInteractiveScreenshot(screenshotSelection ?selection = "Window")

Only supported on macOS.

Device

Display Sleep

Only puts the Mac display to sleep, device remains awake.

displaySleep()

Only supported on macOS.


Sleep

Puts the Mac to sleep.

sleep()

Only supported on macOS.


Start Screensaver

startScreensaver()

Only supported on macOS.

Scripts

Run Apple Script

runAppleScript(rawtext script, variable input)

Only supported on macOS.


Run JavaScript for Automation

runJSAutomation(variable input, text script)

Only supported on macOS.


Run Shell Script

runShellScript(text script, variable input, text ?shell = "/bin/zsh", text ?inputMode = "to stdin")

Only supported on macOS.

Windows

Get Windows

enum windowSorting {
    'Title',
    'App Name',
    'Width',
    'Height',
    'X Position',
    'Y Position',
    'Window Index',
    'Name',
    'Random',
}

enum sortOrder {
    'asc',
    'desc',
}

getWindows(windowSorting ?sortBy, sortOrder ?orderBy, number ?limit)

Only supported on macOS.


Move Window

Move a window to a defined position.

enum windowPosition {
    'Top Left',
    'Top Center',
    'Top Right',
    'Middle Left',
    'Center',
    'Middle Right',
    'Bottom Left',
    'Bottom Center',
    'Bottom Right',
    'Coordinates',
}

moveWindow(variable window, windowPosition position, bool ?bringToFront = true)

Only supported on macOS.


Resize Window

Resize a window to defined size.

enum windowSize {
    'Fit Screen',
    'Top Half',
    'Bottom Half',
    'Left Half',
    'Right Half',
    'Top Left Quarter',
    'Top Right Quarter',
    'Bottom Left Quarter',
    'Bottom Right Quarter',
    'Dimensions',
}

resizeWindow(variable window, windowSize configuration)

Only supported on macOS.


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.