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 b6d416d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ocu/calendars/get-calendar-events.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,10 @@ 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
-- Documentation for opening System Setting panes with AppleScript:
-- <https://gist.github.com/rmcdongit/f66ff91e0dad78d4d6346a75ded4b751>
do shell script "open x-apple.systempreferences:com.apple.preference.security?Privacy_Calendars"
-- Explicitly abort the script with an error
error number -128
end if
Expand Down

0 comments on commit b6d416d

Please sign in to comment.