Luckily, all is not lost! Thanks to applescript, we can toggle the option using script file. Open up 'Script Editor' and use this script:
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 & Mouse" of process "System Preferences"
click checkbox "Use all F1, F2, etc. keys as standard function keys"
end tell
else
tell application "System Preferences"
activate
set current pane ¬
to pane "com.apple.preference.universalaccess"
display dialog ¬
"UI element scripting is not enabled. Check \"Enable access for assistive devices\""
end tell
end if
end tell
tell application "System Preferences"
quit
end tell
This means, when you run the script, it will open the system preferences menu (without making it active), set the option, and close it again. Now, in order to make this useful, we need a way to associate this with a hotkey. So, we need to get the program Spark. This will let you set any hotkey you want to any thing else you want. Once you download it and it opens, you'll add a new hotkey for AppleScript, pick the key (I use F19), and point it to the applescript file (or just use the code above).
Once it is saved, everything is set up and ready to go! Happy terminal-ing!
2 comments:
Hey man, I googled for "as standard function keys" and found you post on the second page. It should be the 1st link cause it works! Thanks!
Thanks! Works great! This was the first time ever actually using the script editor (now called "Applescript editor") after having a Mac over three years!
As an update, to work on OSX 10.6, change this process
tell tab group 1 of window "Keyboard & Mouse" of process "System Preferences"
to this
tell tab group 1 of window "Keyboard" of process "System Preferences"
And it should work. All I did was edit "Keyboard & Mouse" by deleting "& Mouse" so it is "Keyboard"
Post a Comment