Skip to content

Instantly share code, notes, and snippets.

@alampros
alampros / ToggleFunctionKeys.scpt
Last active July 4, 2016 05:07
AppleScript to toggle "Use all F1, F2, etc. keys as standard function keys" in System Preferences > Keyboard.
--Originally posted by "kiodane" at http://forums.macrumors.com/showthread.php?t=383969
tell application "System Preferences"
set current pane to pane "com.apple.preference.keyboard"
end tell
tell application "System Events"
if UI elements enabled then
tell tab group 1 of window "Keyboard" of process "System Preferences"
click checkbox "Use all F1, F2, etc. keys as standard function keys"
if (do shell script "defaults read -g com.apple.keyboard.fnState") = "1" then