macOS Only Actions

Table of contents

  1. Get Apps
  2. Make Disk Image
  3. Make Size 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

Make Disk Image

Create a new disk image.

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

Make Size Disk Image

Make a sized disk image.

makeSizedDiskImage(text name, variable contents, text ?size = "1 GB", bool ?encrypt = false)

Take Interactive Screenshot

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

takeInteractiveScreenshot(screenshotSelection ?selection = "Window")

Device

Display Sleep

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

displaySleep()

Sleep

Puts the Mac to sleep.

sleep()

Start Screensaver

startScreensaver()

Scripts

Run Apple Script

runAppleScript(variable input, text script)

Run JavaScript for Automation

runJSAutomation(variable input, text script)

Run Shell Script

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

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)

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)

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)

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.