UI scripts to toggle between hardware and software function key mappings on Mac OS X

As a Mac user, especially with a Mac laptop, you are probably using your function keys to control brightness, volume, etc. all the time.

However, some applications, such as Eagle or Photoshop, use the function keys to provide very useful shortcuts to frequently used commands.

You can use the "fn" modifier key to get to those commands, but that's not exactly satisfying given that you're trying to save keystrokes by using these shortcuts for frequent commands.

Or, you can toggle the setting in the "Keyboard & Mouse" pane of System Preferences - but that's a far trip each time before and after using such applications. You're also bound to forget about toggling it, which will leave you always wondering if your function keys currently work this way or that.

The attached two AppleScripts use UI Scripting to check or uncheck that "Use all F1, F2, etc. keys as standard function keys" checkbox in System Preferences. Just download and unzip the archive, add the scripts to your Dock, and they should turn software function keys on or off with a single click. The first script checks the corresponding box, the second unchecks it. The icons should help you to tell them apart. They both verify the checkbox' status beforehand to make sure they always check or uncheck the box no matter what it was before. UI scripting requires Assistive Devices Support to be turned on; the scripts check for that as well, and open the corresponding Universal Access pane if it's not on so you can fix it (obviously they can't set it themselves in this case, haha).

Caveats: These work under Mac OS X 10.5 (Leopard) in US English. UI scripting sometimes has to rely on matching literal strings in the user interface, so these scripts are likely to break in the next OS release, and sure to break in different UI languages (although fixing them should be easy enough).

--Jan Borchers
Attachments:
File Description File size Downloads Last modified
FunctionKeyScripts.zip Software and Hardware Function Keys (jan) 53 kB 4821 2008-08-02 18:56

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.