From e8d1f2ade4412ca9d6f1ec1eadcdcfc090a76a05 Mon Sep 17 00:00:00 2001 From: hahaSK Date: Thu, 14 Oct 2021 22:46:21 +0300 Subject: [PATCH 1/2] Imported Cocoa - fixed AXError not found --- Sources/AXPropertyDelegate.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/AXPropertyDelegate.swift b/Sources/AXPropertyDelegate.swift index 05fc8b8..e74a6d8 100644 --- a/Sources/AXPropertyDelegate.swift +++ b/Sources/AXPropertyDelegate.swift @@ -1,6 +1,7 @@ import Foundation import AXSwift import PromiseKit +import AppKit /// Implements PropertyDelegate using the AXUIElement API. class AXPropertyDelegate: PropertyDelegate { From 04cbe98632b36c66c2af0415bdb9756713cff456 Mon Sep 17 00:00:00 2001 From: hahaSK Date: Thu, 14 Oct 2021 22:47:12 +0300 Subject: [PATCH 2/2] Fixed crashing of forcefully unwrapping --- Sources/Application.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Application.swift b/Sources/Application.swift index a018474..90fc023 100644 --- a/Sources/Application.swift +++ b/Sources/Application.swift @@ -112,10 +112,10 @@ final class OSXApplicationDelegate< var isHidden: WriteableProperty>! var processIdentifier: pid_t! - lazy var runningApplication: NSRunningApplication = - NSRunningApplication(processIdentifier: self.processIdentifier)! + lazy var runningApplication: NSRunningApplication? = + NSRunningApplication(processIdentifier: self.processIdentifier) lazy var bundleIdentifier: String? = - self.runningApplication.bundleIdentifier + self.runningApplication?.bundleIdentifier var knownWindows: [WindowDelegate] { return windows.map({ $0 as WindowDelegate })