Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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