Script to change keyboard modifer keys?
-------------------------------------------------------------------------------
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.keyboard"
tell application "System Events"
tell process "System Preferences"
click button "Modifier Keys…" of tab group 1 of window "Keyboard & Mouse"
set curOpt to (get value of pop up button 3 of sheet 1 of window "Keyboard & Mouse")
set curCmd to (get value of pop up button 4 of sheet 1 of window "Keyboard & Mouse")
tell sheet 1 of window "Keyboard & Mouse"
tell pop up button 3
click
click menu item curCmd
end tell
tell pop up button 4
click
click menu item curOpt
end tell
end tell
click button "Ok" of sheet 1 of window "Keyboard & Mouse"
end tell
end tell
quit
end tell
-------------------------------------------------------------------------------
I am trying to get this to work on OS X 10.6 with no luck. Firstly I have seperate options in System Preferences for Keyboard and Mouse settings (the script above points to window "Keyboard & Mouse") and secondly, even after changing the "Keyboard & Mouse" to just "Keyboard" I get an error message about not being about to locate button "Modifier Keys...".
All I'm trying to do is change the Modifier Keys so that Crtl key is set to nothing. Could anyone help me out?
Mac Mini, Mac OS X (10.6.5)