From dcb934c423a68a6900598685d234d909e62bd5b8 Mon Sep 17 00:00:00 2001 From: Louis Pontoise Date: Fri, 25 Oct 2019 00:02:13 +0900 Subject: [PATCH] chore: better error messages --- alt-tab-macos/logic/Preferences.swift | 1 - alt-tab-macos/logic/SystemPermissions.swift | 10 ++++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/alt-tab-macos/logic/Preferences.swift b/alt-tab-macos/logic/Preferences.swift index 8c14de1cc..368fa0da3 100644 --- a/alt-tab-macos/logic/Preferences.swift +++ b/alt-tab-macos/logic/Preferences.swift @@ -46,7 +46,6 @@ class Preferences { metaKeyArray[4]: (63, .function), ] - private static let defaultsFile = fileFromPreferencesFolder("alt-tab-macos-defaults.json") private static let userFile = fileFromPreferencesFolder("alt-tab-macos.json") diff --git a/alt-tab-macos/logic/SystemPermissions.swift b/alt-tab-macos/logic/SystemPermissions.swift index 8c5fb06d2..968bb543b 100644 --- a/alt-tab-macos/logic/SystemPermissions.swift +++ b/alt-tab-macos/logic/SystemPermissions.swift @@ -4,7 +4,10 @@ import Cocoa class SystemPermissions { static func ensureAccessibilityCheckboxIsChecked() { if !AXIsProcessTrustedWithOptions(["AXTrustedCheckOptionPrompt": true] as CFDictionary) { - debugPrint("Before using this app, you need to give permission in System Preferences > Security & Privacy > Privacy > Accessibility.\nPlease authorize and re-launch.\nSee https://help.rescuetime.com/article/59-how-do-i-enable-accessibility-permissions-on-mac-osx") + debugPrint("Before using this app, you need to give permission in System Preferences > Security & Privacy > Privacy > Accessibility.", + "Please authorize and re-launch.", + "See https://help.rescuetime.com/article/59-how-do-i-enable-accessibility-permissions-on-mac-osx", + separator: "\n") NSApp.terminate(self) } } @@ -13,7 +16,10 @@ class SystemPermissions { let firstWindow = cgWindows()[0] let windowImage = CGWindowListCreateImage(.null, .optionIncludingWindow, firstWindow[kCGWindowNumber] as! CGWindowID, [.boundsIgnoreFraming, .bestResolution]) if windowImage == nil { - debugPrint("Before using this app, you need to give permission in System Preferences > Security & Privacy > Privacy > Screen Recording.\nPlease authorize and re-launch.\nSee https://dropshare.zendesk.com/hc/en-us/articles/360033453434-Enabling-Screen-Recording-Permission-on-macOS-Catalina-10-15-") + debugPrint("Before using this app, you need to give permission in System Preferences > Security & Privacy > Privacy > Screen Recording.", + "Please authorize and re-launch.", + "See https://dropshare.zendesk.com/hc/en-us/articles/360033453434-Enabling-Screen-Recording-Permission-on-macOS-Catalina-10-15-", + separator: "\n") NSApp.terminate(self) } }