Basic Actions

Table of contents

  1. Comment
  2. Count
  3. Get Object of Class
  4. Get Type
  5. Nothing
  6. Number
  7. Stop Shortcut
  8. Control Flow
    1. Wait
    2. Wait to Return
  9. Notifications
    1. Alert
    2. Ask for Input
    3. Confirm
    4. Show Notification
  10. Output
    1. Content Graph
    2. Must Output
    3. Output or Copy to Clipboard
    4. Quick Look
    5. Show Result
    6. Stop and Output

Actions in this category are automatically included.

Comment

Add an explicit comment.

comment(rawtext text)

Count

Returns a count of type of items in input.

enum countType {
    'Items',
    'Characters',
    'Words',
    'Sentences',
    'Lines',
}

count(variable input, countType ?type = "Items"): number

Get Object of Class

Get the object of class from a variable.

getObjectOfClass(text class, variable from)

Get Type

Get the type of input.

typeOf(variable input): text

Nothing

Clear the current output.

nothing()

Number

Create a number value.

number(number number): number

Stop Shortcut

Stops the shortcut.

stop()

Control Flow

Wait

Wait a specified number of seconds.

wait(number seconds)

Wait to Return

Wait for the user to return to Shortcuts.

waitToReturn()

Notifications

Alert

Shows an alert with text and optional title and an OK button to proceed.

alert(text alert, text ?title)

Ask for Input

Ask for input with prompt, with optional inputType and defaultValue.

enum inputType {
    'Text',
    'Number',
    'URL',
    'Date',
    'Time',
    'Date and Time',
}

prompt(text prompt, inputType ?inputType = "Text", text ?defaultValue, text ?multiline = true)

Confirm

Shows an alert with text and optional title. It displays an OK button to proceed, and a cancel button that stops the Shortcut.

confirm(text alert, text ?title)

Show Notification

Shows a custom notification message.

showNotification(text body, text ?title, bool ?playSound = true, variable ?attachment)

Output

Content Graph

Display input as a content graph.

contentGraph(variable input)

Must Output

Stop and output output. Respond with response if there is nowhere to output.

mustOutput(text output, text response)

Output or Copy to Clipboard

Stop and output output. Copy to the clipboard if there is nowhere to output.

outputOrClipboard(text output)

Quick Look

Preview input in Quick Look.

quicklook(variable input)

Show Result

Show input.

show(text input)

Stop and Output

Stop and output output. Do nothing if there is nowhere to output.

output(text output)

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.