Skip to content

Commit

Permalink
Fix disableAccessibilityPermission option (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
kentbetita authored Mar 2, 2024
1 parent 9c7207c commit 34659a0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Sources/ActiveWinCLI/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@ let disableScreenRecordingPermission = CommandLine.arguments.contains("--no-scre
let enableOpenWindowsList = CommandLine.arguments.contains("--open-windows-list")

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

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

0 comments on commit 34659a0

Please sign in to comment.