Skip to content

args

Arguments passed to the script.

Arguments are passed to the script when the script is executed from a share sheet. You can specify the types of arguments a script supports from the script settings.

All arguments supplied by a share sheet.

all: [any]

All arguments supplied by the share sheet.

Read-only.

File URLs supplied by a share sheet or a shortcut action.

fileURLs: [string]

All file URLs passed to the script from a share sheet or a shortcut action.

If you have enabled “File URLs” as a share sheet input from the script settings, the script can be run from any share sheet throughout the system that shares URLs pointing to a file.

Shortcut actions run in the Scriptable app process. Share Sheet extensions have less memory available; enable “Always run in app” when sharing large files.

Read-only.

Images supplied by a share sheet or a shortcut action.

images: [Image]

All images passed to the script from a share sheet or a shortcut action.

If you have enabled “Images” as a share sheet input from the script settings, the script can be run from any share sheet throughout the system that shares images.

Shortcut actions run in the Scriptable app process. Share Sheet extensions have less memory available; enable “Always run in app” when sharing large images.

Read-only.

Number of arguments supplied by a share sheet.

length: number

The number of arguments passed to the script from the share seeht.

Read-only.

Notification being handled by the script.

notification: Notification

The notification that a script is being run in or the application was opened from.

The notification contains all information that was set when the notification was originally scheduled, including the userInfo property which can be used to contain custom data that might be relevant when running the script.

Read-only.

Plain texts supplied by a share sheet or a shortcut action.

plainTexts: [string]

All plain texts passed to the script from a share sheet or a shortcut action.

If you have enabled “Text” as a share sheet input from the script settings, the script can be run from any share sheet throughout the system that shares plain text.

Read-only.

Query parameters from a URL scheme.

queryParameters: {string: string}

Query parameters are supplied to a script when running it from a URL scheme. See the documentation on Scriptables URL schems for more information.

Read-only.

Parameter passed to a Shortcut.

shortcutParameter: any

When creating a shortcut using the Shortcuts app, you can pass an input parameter that can be read in your script using args.shortcutParameter.

This parameter can be any text, list, dictionary or file and will be exposed in your script using the appropriate type. When passing a file, the “Run Script” action will attempt to read the file as JSON or a plain text. If the file cannot be read as JSON or a plain text, a path to the file will be passed as the input parameter.

Read-only.

Arguments passed from a Siri Shortcut.

siriShortcutArguments: {string: string}

When creating a Siri Shortcut in Scriptable, you can define arguments that are passed to the script when the shortcut is run. This lets you differentiate the behavior of a script based on some predefiend arguments.

For example, a script that checks the wather may expect an argument with the key “city”. When creating a Siri Shortcut for the script, the argument should be passed with the value containing the name of the city to check the weather for.

Read-only.

URLs supplied by a share sheet or a shortcut action.

urls: [string]

All URLs passed to the script from a share sheet or a shortcut action.

If you have enabled “URLs” as a share sheet input from the script settings, the script can be run from any share sheet throughout the system that shares URLs.

Read-only.

Parameter passed to a widget.

widgetParameter: any

When creating a widget on the Home screen, you can define a parameter that can be read in your script using args.widgetParameter.

The parameter can be used to differentiate the behavior of multiple widgets.

Read-only.

Action triggered by a widget control.

widgetAction: any

A dictionary with the control’s id. For a toggle, it also contains isOn, the requested Boolean state. This property is null during a normal widget render and when running a script elsewhere. Await any asynchronous work in the action before returning. Persist data that the next widget render needs.

Read-only.