---
title: Script
description: Access information about the script.
---

Access information about the script.

Allows for accessing information about the script that is currently being run and controlling selected parts of the script execution.

## Methods

### complete()

Informs the system about script completion.

```typescript
static complete()
```

Call this function to inform the system that the script has completed running.

Siri and Shortcuts wait for the script and its pending asynchronous work. Await asynchronous work before returning. Use this function as the final action when explicitly completing a script that uses callbacks.

When the script is run from a share sheet, the `complete` function will complete execution and dismiss the presented view.

### name()

Name of the script.

```typescript
static name(): string
```

#### Return value

**`string`**



<span id="setshortcutoutput" class="api-anchor"></span>

### setShortcutOutput(value)

Sets output when running the script as a shortcut action.

```typescript
static setShortcutOutput(value: any)
```

Use this function to pass values to other actions in the Shortcuts app. The output can be a text, a number, a boolean, a dictionary or a file path pointing to a file stored in iCloud.

You can also use JavaScript's `return` keyword to output a value to a shortcut.

#### Parameters

**`value` `any`**

Value to provide as output.

<span id="setwidget" class="api-anchor"></span>

### setWidget(widget)

Sets the widget to be displayed.

```typescript
static setWidget(widget: any)
```

#### Parameters

**`widget` `any`**

Widget to display.