Advertisement
Guest User

Untitled

a guest
Jan 1st, 2022
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. tell application "System Preferences"
  2. set current pane to pane "com.apple.preference.keyboard"
  3. end tell
  4.  
  5. tell application "System Events"
  6. if UI elements enabled then
  7. tell application process "System Preferences"
  8. repeat until exists tab group 1 of window "Keyboard"
  9. delay 0.5
  10. end repeat
  11. click radio button "Keyboard" of tab group 1 of window "Keyboard"
  12. click checkbox "Use F1, F2, etc. keys as standard function keys" of tab group 1 of window "Keyboard"
  13. end tell
  14. tell application "System Preferences" to quit
  15. else
  16. -- GUI scripting not enabled. Display an alert
  17. tell application "System Preferences"
  18. activate
  19. set current pane to pane "com.apple.preference.security"
  20. display dialog "UI element scripting is not enabled. Please activate this app under Privacy -> Accessibility so it can access the settings it needs."
  21. end tell
  22. end if
  23. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement