Last active
December 18, 2021 19:14
Star
You must be signed in to star a gist
AppleScript pour commuter "Utiliser les touches F1, F2 etc. comme des touches de fonction standard" dans Preferences Système.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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