// // SettingsOpener.swift // Zyquo Cloud // // Author: Simon-Pierre Boucher // Mail: contact@spboucher.ai // // Opens the Settings scene from anywhere. SwiftUI's openSettings environment // action requires macOS 14; this selector-based helper works on macOS 13 too. // import AppKit enum SettingsOpener { @MainActor static func open() { NSApplication.shared.activate(ignoringOtherApps: true) // macOS 13+ selector for the SwiftUI Settings scene. if NSApp.responds(to: Selector(("showSettingsWindow:"))) { NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil) } else { NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil) } } }