Skip to content

Commit 34659a0

Browse files
authored
Fix disableAccessibilityPermission option (#180)
1 parent 9c7207c commit 34659a0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Sources/ActiveWinCLI/main.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,11 @@ let disableScreenRecordingPermission = CommandLine.arguments.contains("--no-scre
8989
let enableOpenWindowsList = CommandLine.arguments.contains("--open-windows-list")
9090

9191
// Show accessibility permission prompt if needed. Required to get the URL of the active tab in browsers.
92-
if
93-
!disableAccessibilityPermission,
94-
!AXIsProcessTrustedWithOptions(["AXTrustedCheckOptionPrompt": true] as CFDictionary)
95-
{
96-
print("active-win requires the accessibility permission in “System Settings › Privacy & Security › Accessibility”.")
97-
exit(1)
92+
if !disableAccessibilityPermission {
93+
if !AXIsProcessTrustedWithOptions(["AXTrustedCheckOptionPrompt": true] as CFDictionary) {
94+
print("active-win requires the accessibility permission in “System Settings › Privacy & Security › Accessibility”.")
95+
exit(1)
96+
}
9897
}
9998

10099
// Show screen recording permission prompt if needed. Required to get the complete window title.

0 commit comments

Comments
 (0)