NSWindowScripting

Category on NSWindow. Supports window scripting for all scriptable Cocoa applications by getting and setting standard properties and handling the close, print, and save AppleScript commands.

Symbols

Getting scripting attribute information about a window

var hasCloseBox: Bool

Returns true if the receiver has a close box.

var hasTitleBar: Bool

Returns true if the receiver has a title bar.

Setting scripting attribute information for a window

func setIsMiniaturized(Bool)

Sets the receiver’s miniaturized state to the value specified by flag.

func setIsVisible(Bool)

Sets the receiver’s visible state to the value specified by flag.

func setIsZoomed(Bool)

Sets the receiver’s zoomed state to the value specified by flag.

Handling script commands

func handleClose(NSCloseCommand)

Handles the close AppleScript command by attempting to close the window (and its associated document, if any).

func handlePrint(NSScriptCommand)

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

func handleSave(NSScriptCommand)

Handles the save AppleScript command by attempting to save the window (and its associated document, if any).

Working with ordered indices

var orderedIndex: Int

Sets the zero-based position of the receiver, based on its order from front to back among all visible application windows, to the value specified by index. If index is out of range, sets the position to the nearest value that is in range.