<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSUserAppleScriptTask/CompletionHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@T@NSUserAppleScriptTaskCompletionHandler"
  },
  "title" : "NSUserAppleScriptTask.CompletionHandler"
}
-->

# NSUserAppleScriptTask.CompletionHandler

Implement this block to retrieve the result of the AppleScript executed by [`execute(withAppleEvent:completionHandler:)`](/documentation/Foundation/NSUserAppleScriptTask/execute(withAppleEvent:completionHandler:)).

```
typealias CompletionHandler = @Sendable (NSAppleEventDescriptor?, (any Error)?) -> Void
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)