---
title: "handlePrint(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/handleprint(_:)"
---

# handlePrint(_:)

Handles the AppleScript command to print the contents of the window (or its associated document, if any).

## Declaration

```swift
func handlePrint(_ command: NSScriptCommand) -> Any?
```

## Discussion

Discussion If there’s a corresponding document and the window is the main window of the document, it forwards the print command to the corresponding document. Otherwise, the window sends itself a print message.

## See Also

### Handling Script Commands

- [handleClose(_:)](appkit/nswindow/handleclose(_:).md)
- [handleSave(_:)](appkit/nswindow/handlesave(_:).md)
