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

REBELinBLUE

macrumors 6502
Original poster
Oct 2, 2007
292
35
London, UK
Does anyone know if it is possible to automatically disable the keyboard backlight on the new MBP when an external keyboard is attached? If so how do I achieve it. I'll looked around but couldn't find anything.
 

ergdegdeg

Moderator emeritus
Oct 13, 2007
1,628
0
Another perfect situation for Marco Polo. You can choose to use an Apple Script to disable the keyboard lighting when an external keyboard is attached.
 

REBELinBLUE

macrumors 6502
Original poster
Oct 2, 2007
292
35
London, UK
Oh thanks. I was playing around with that app yesterday for something else but that didn't even come to mind. Will play around with it again.
 

ergdegdeg

Moderator emeritus
Oct 13, 2007
1,628
0
Set up a new USB rule (if you're using a wired keyboard) and give it a 100% confidence, when your keyboard is connected. The context would be "with keyboard" or whatever you name it. Then add an action to run an applescript when the context changes to "with keyboard". As for the applescript, you might want to google around.
 

REBELinBLUE

macrumors 6502
Original poster
Oct 2, 2007
292
35
London, UK
Yeah I knew how to use Marco Polo, it was the AppleScript I couldn't figure out

anyway I figured it out with some playing around, it is not pretty and I'm sure there is a better way to do it

Code:
tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.keyboard"
end tell
tell application "System Events"
	if UI elements enabled then
		tell application process "System Preferences"
			get properties
			if value of checkbox "Illuminate keyboard in low light conditions" of group 1 of tab group 1 of window "Keyboard & Mouse" is 1 then
				click checkbox "Illuminate keyboard in low light conditions" of group 1 of tab group 1 of window "Keyboard & Mouse"
			end if
		end tell
		tell application "System Preferences" to quit
	else
		tell application "System Preferences"
			activate
			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

Saved as disable and then changing "is 1 then" to "is 0 then" as the enable script.

Thanks for your help
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.