F-Keys Quickly

The function keys on the Mac are very useful in a few apps (Flash’s F5-8 and Motion’s F1-3 come to mind) but the rest of the time it’s probably more useful to have the media keys (volume, brightness etc.) up front. Yes, you can hold “fn” to get the other option, but that’s tedious. So is switching the priority in System Preferences > Keyboard all the time.

So, get a script to do it for you and use FastScripts to assign a shortcut key to it (F13, just above “fn”, is recommended). The only problem is that the posted script works on Leopard, but not Snow Leopard. So… here’s the modified script for 10.6:


tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.keyboard"
end tell

tell application "System Events"
-- If we don't have UI Elements enabled, then nothing is really going to work.
if UI elements enabled then
tell application process "System Preferences"
get properties

click radio button "Keyboard" of tab group 1 of window "Keyboard"
click checkbox "Use all F1, F2, etc. keys as standard function keys" of tab group 1 of window "Keyboard"
end tell
tell application "System Preferences" to quit
else
-- GUI scripting not enabled. Display an alert
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.universalaccess"
display dialog "UI element scripting is not enabled. Please activate "Enable access for assistive devices""
end tell
end if
end tell

Convenient. Now you can use volume easily most of the time, but switch to the function keys for editing or animation.