Skip to content

Instantly share code, notes, and snippets.

@kemar
Last active December 18, 2021 19:14
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kemar/37d96f496ce3a71d1282e3ccda26d641 to your computer and use it in GitHub Desktop.
AppleScript pour commuter "Utiliser les touches F1, F2 etc. comme des touches de fonction standard" dans Preferences Système.
-- osascript toggle_function_keys.scpt
-- Inspired by https://gist.github.com/alampros/2b81af6cfc564f6accd3
tell application "System Preferences"
reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard"
end tell
tell application "System Events" to tell process "System Preferences"
set checkbox_target to false
-- Set up an infinite loop to wait for the checkbox to appear in the UI.
repeat
try
set checkbox_target to (checkbox "Utiliser les touches F1, F2 etc. comme des touches de fonction standard" of tab group 1 of window "Clavier")
end try
if checkbox_target is not false then
exit repeat
end if
end repeat
click checkbox_target
if (value of checkbox_target as boolean) is false then
display notification "Touches de fonction Mac activées"
else
display notification "Touches de fonction standard activées"
end if
end tell
quit application "System Preferences"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment