-
-
Save alex-cory/541db4e4218a67db51c4 to your computer and use it in GitHub Desktop.
applescript to toggle the fn key
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
--Check if GUI Scripting is Enabled | |
tell application "System Events" | |
if not UI elements enabled then | |
set UI elements enabled to true | |
end if | |
end tell | |
--Enable/Disable "Use all F1, F2, etc. keys as standard function keys" option in Keyboard & Mouse Preference pane and close System Preferences | |
tell application "System Events" | |
tell application "System Preferences" | |
reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard" | |
end tell | |
set bbox to checkbox 1 of tab group 1 of window 1 of application process "System Preferences" | |
click bbox | |
set b to value of bbox | |
if b is 0 | |
set q to "Apple" | |
else | |
set q to "Fn" | |
end if | |
end tell | |
if application "System Preferences" is running then | |
tell application "System Preferences" to quit | |
end if | |
return q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment