Skip to content

Commit

Permalink
chore: better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Pontoise committed Oct 24, 2019
1 parent 14413b0 commit dcb934c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion alt-tab-macos/logic/Preferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
10 changes: 8 additions & 2 deletions alt-tab-macos/logic/SystemPermissions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand All @@ -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)
}
}
Expand Down

0 comments on commit dcb934c

Please sign in to comment.