NSWindow​Scripting

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 has​Close​Box:​ Bool

Returns true if the receiver has a close box.

var has​Title​Bar:​ Bool

Returns true if the receiver has a title bar.

Setting scripting attribute information for a window

func set​Is​Miniaturized(Bool)

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

func set​Is​Visible(Bool)

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

func set​Is​Zoomed(Bool)

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

Handling script commands

func handle​Close(NSClose​Command)

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

func handle​Print(NSScript​Command)

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

func handle​Save(NSScript​Command)

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

Working with ordered indices

var ordered​Index:​ 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.

See Also

Related Documentation