---
title: script
framework: automator
role: symbol
role_heading: Instance Property
path: automator/amapplescriptaction/script
---

# script

An OSAScript object representing the receiver’s script containing the on run command handler.

## Declaration

```swift
@NSCopying var script: OSAScript? { get set }
```

## Discussion

Discussion By default, script is main.applescript, which is stored in the action bundle. You can use setScript: to set the receiver’s script to newScript, where newScript must be an OSAScript object that could be instantiated from a script in the action bundle. script must contain the on run command handler.
