Skip to content

Commit

Permalink
Improve Calendar access alert messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb531 committed Sep 27, 2023
1 parent 252f170 commit 3eedba7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ocu/calendars/get-calendar-events.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,8 @@ on run(listOfCalNames)
-- authorization
set authorizationStatus to current application's EKEventStore's authorizationStatusForEntityType:0 -- work around enum bug
if authorizationStatus is not 3 then
display dialog "Access must be given in System Preferences" & linefeed & "-> Security & Privacy first." buttons {"OK"} default button 1
tell application "System Preferences"
activate
tell pane id "com.apple.preference.security" to reveal anchor "Privacy"
end tell
display dialog "Access must be given in System Settings" & linefeed & "-> Security & Privacy first." buttons {"OK"} default button 1
tell application "System Settings" to activate
-- Explicitly abort the script with an error
error number -128
end if
Expand Down

0 comments on commit 3eedba7

Please sign in to comment.