Jump to content

Toggle fn key/ Apple key workflow


Recommended Posts

  • 3 months later...

Hi there,

after I updated to OS X 10.9 Mavericks. The Script didn't work. 

I found this one which works except not passing the {query} to the Post Notification.

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" of process "System Preferences"
			click checkbox "Use all F1, F2, etc. keys as standard function keys"

			if (do shell script "defaults read -g com.apple.keyboard.fnState") = "1" then
				set fnStateRead to "Special Keys - Volume, iTunes..."
			else
				set fnStateRead to "Function Keys - F1, F2, F3..."
			end if

			do shell script "~/Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier -message \"Function Swapper, an AS & Shell script\" -title \"" & fnStateRead & "\"  -activate com.orderedbytes.ControllerMate4"

		end tell
	else
		tell application "System Preferences"
			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

Hope this helps.

 

Have fun!

Edited by Puck
Link to comment
  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...