From ed9a6cb6488ff282a5061bbd016d9082d7c3e773 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 7 Mar 2026 07:28:56 -0800 Subject: [PATCH] macos: implement the quit command --- .../Features/AppleScript/AppDelegate+AppleScript.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/macos/Sources/Features/AppleScript/AppDelegate+AppleScript.swift b/macos/Sources/Features/AppleScript/AppDelegate+AppleScript.swift index 24309b348..de7b4948c 100644 --- a/macos/Sources/Features/AppleScript/AppDelegate+AppleScript.swift +++ b/macos/Sources/Features/AppleScript/AppDelegate+AppleScript.swift @@ -196,6 +196,16 @@ extension NSApplication { return ScriptWindow(primaryController: controller) } + /// Handler for the `quit` AppleScript command. + /// + /// Required selector name from the command in `sdef`: + /// `handleQuitScriptCommand:`. + @objc(handleQuitScriptCommand:) + func handleQuitScriptCommand(_ command: NSScriptCommand) { + guard validateScript(command: command) else { return } + terminate(nil) + } + /// Handler for the `new tab` AppleScript command. /// /// Required selector name from the command in `sdef`: