Instance Method


Tells the delegate to open a temporary file.


optional func application(_ sender: NSApplication, openTempFile filename: String) -> Bool



The application object associated with the delegate.


The name of the temporary file to open.

Return Value

true if the file was successfully opened or false if it was not.


Sent directly by theApplication to the delegate. The method should attempt to open the file filename, returning true if the file is successfully opened, and false otherwise.

By design, a file opened through this method is assumed to be temporary—it’s the application’s responsibility to remove the file at the appropriate time.

See Also

Opening Files

func application(NSApplication, openFile: String) -> Bool

Tells the delegate to open a single file.

func application(Any, openFileWithoutUI: String) -> Bool

Tells the delegate to open a file programmatically.

func application(NSApplication, openFiles: [String])

Tells the delegate to open multiple files.

func applicationOpenUntitledFile(NSApplication) -> Bool

Tells the delegate to open an untitled file.

func applicationShouldOpenUntitledFile(NSApplication) -> Bool

Invoked immediately before opening an untitled file.