Instance Method


Handles the Close AppleScript command by attempting to close the document.


func handleClose(_ command: NSCloseCommand) -> Any?



A Close AppleScript command object.


Extracts Close command arguments from the command object and uses them to determine how to close the document—specifically, whether to ignore unsaved changes, save changes automatically, or ask the user and to identify the file in which to save the document (by default, the file that was opened or previously saved to). A Close AppleScript command may specify more than one document to close. If so, a message is sent to each document object.

See Also


func handlePrint(NSScriptCommand) -> Any?

Handles the Print AppleScript command by attempting to print the document.

func handleSave(NSScriptCommand) -> Any?

Handles the Save AppleScript command by attempting to save the document.

var objectSpecifier: NSScriptObjectSpecifier

Returns an object specifier for the document.

var lastComponentOfFileName: String

Sets the document name to the given string in terms of the scripting name property (the name a script writer would use to specify the document in a script).