---
title: "compileAndReturnError(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsapplescript/compileandreturnerror(_:)"
---

# compileAndReturnError(_:)

Compiles the receiver, if it is not already compiled.

## Declaration

```swift
func compileAndReturnError(_ errorInfo: AutoreleasingUnsafeMutablePointer<NSDictionary?>?) -> Bool
```

## Parameters

- `errorInfo`: On return, if an error occurs, a pointer to an error information dictionary.

## Return Value

Return Value true for success or if the script was already compiled, false otherwise.

## See Also

### Compiling and Executing a Script

- [executeAndReturnError(_:)](foundation/nsapplescript/executeandreturnerror(_:).md)
- [executeAppleEvent(_:error:)](foundation/nsapplescript/executeappleevent(_:error:).md)
