Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command I can issue via terminal to switch my F1-12 keys to being application keys (media, screen brightness ...) and back? i.e. replicate toggling System Preferences => Keyboard => Use all F1, F2, etc. keys as standard function keys. My mac is pretty much used for browsing and music but it is nice not to have to fn to the F keys when occasionally doing some Chrome debugging.

share|improve this question
up vote 4 down vote accepted

I only know how to do this via UI scripting. Open up AppleScript Editor, and paste the following:

tell application "System Preferences"
    set current pane to pane ""
end tell

tell application "System Events"
    tell application process "System Preferences"
        click checkbox 1 of tab group 1 of window "Keyboard"
    end tell
    tell application "System Preferences" to quit
end tell

Like this:

Save it under any name you like. From a Terminal, you can then run:

osascript toggle-f.scpt
share|improve this answer
Here's a more extensive version: – huyz Dec 29 '12 at 9:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.