<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPrintOperation/run()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPrintOperation(im)runOperation"
  },
  "title" : "run()"
}
-->

# run()

Runs the print operation on the current thread.

```
func run() -> Bool
```

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the operation was successful; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The operation runs to completion in the current thread, blocking the application. A separate thread is not spawned, even if [`canSpawnSeparateThread`](/documentation/AppKit/NSPrintOperation/canSpawnSeparateThread) is <doc://com.apple.documentation/documentation/Swift/true>. Use [`runModal(for:delegate:didRun:contextInfo:)`](/documentation/AppKit/NSPrintOperation/runModal(for:delegate:didRun:contextInfo:)) to use document-modal sheets and to allow a separate thread to perform the operation.

---

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)