Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ifjake

macrumors 6502a
Original poster
Jan 19, 2004
563
2
So I know how in keyboard preferences to mark the check box that says "Use function keys as standard function keys," but my question is, is there a way to use a hot key to make this swap instead of having to open up system preferences, navigate to the proper pane and tab, and click the box? I have a couple programs where I absolutely need function keys to be function keys, but for general purpose use, I need the function keys to be the spiffy stuff printed on them.

Ideally I'd love for the system to look at what app was in the foreground (that is, has control of the menu bar) and recognize this app as needing access to function-function keys and make the swap for me, but I don't think this is possible at the moment, and having a hot key to change it would be the next best thing.

Thanks!
 
You could write a small script that will do that for you. I know there's third party software that allows you to assign a script to a hotkey (none that are free, to my knowledge).
 
Last edited:
I use Spark to run scripts via keyboard shortcuts, and it's free.

Try running this one :

Code:
set panelName to "Keyboard"

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 "System Preferences" to activate -- open System Preferences
		set visible of process "System Preferences" to false -- hide it
		tell application "System Preferences" to set current pane to pane "com.apple.preference.keyboard" -- go to keyboard preferences
		tell application process "System Preferences"
			get properties
			try -- try to do the following, assuming System Preferences is in 64-bit mode
				click radio button "Keyboard" of tab group 1 of window panelName
				click checkbox "Use all F1, F2, etc. keys as standard function keys" of tab group 1 of window panelName
			on error -- in case System Pref is open in 32-bit mode
				set panelName32 to panelName & " (32-bit)"
				click radio button "Keyboard" of tab group 1 of window panelName32
				click checkbox "Use all F1, F2, etc. keys as standard function keys" of tab group 1 of window panelName32
			end try
		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
 
Wow thanks, I was thinking I'd probably be an AppleScript angle but all my experience with that has resulted in a lot of spent time. That Sparks find is definitely clutch. Thanks so much.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.