tokenary/Encrypted Ink/Window.swift

18 lines
438 B
Swift
Raw Normal View History

2021-06-12 19:33:24 +03:00
// Copyright © 2021 Encrypted Ink. All rights reserved.
import Cocoa
struct Window {
static func closeAll() {
NSApplication.shared.windows.forEach { $0.close() }
}
static func activateSafari() {
if let browser = NSWorkspace().runningApplications.first(where: { $0.bundleIdentifier == "com.apple.Safari" }) {
browser.activate(options: .activateIgnoringOtherApps)
}
}
}