diff --git a/DockPhobia/MouseTracker.swift b/DockPhobia/MouseTracker.swift index f84d350..8952648 100644 --- a/DockPhobia/MouseTracker.swift +++ b/DockPhobia/MouseTracker.swift @@ -32,11 +32,15 @@ class MouseTracker { fatalError("no screen wtf???") } addMonitor() + applescript("display dialog \"dt\"") } func checkMouse(_ event: NSEvent) { var location = event.locationInWindow + location.y = screen.height - location.y + #if DEBUG print(location) + #endif } func addMonitor() { @@ -46,6 +50,17 @@ class MouseTracker { func removeMonitor() { NSEvent.removeMonitor(monitor as Any) } + + func applescript(_ script: String) { + var error: NSDictionary? + if let scriptObject = NSAppleScript(source: script) { + let output: NSAppleEventDescriptor = scriptObject.executeAndReturnError(&error) + print(output) + if (error != nil) { + print(error as Any) + } + } + } }