-- hubionmac.com 24.03.2011 (tested with 10.6.7)
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.keyboard"
tell application "System Events"
tell process "System Preferences"
click button 1 of tab group 1 of window 1
set curOpt to (get value of pop up button 3 of sheet 1 of window 1)
set curCmd to (get value of pop up button 4 of sheet 1 of window 1)
click pop up button 4 of sheet 1 of window 1
my set_button_item(1)
click pop up button 3 of sheet 1 of window 1
my set_button_item(2)
click pop up button 2 of sheet 1 of window 1
my set_button_item(3)
click pop up button 1 of sheet 1 of window 1
my set_button_item(4)
delay 0.25
keystroke return
end tell
quit
on set_button_item(valueindex)
repeat with i from 1 to 5
key code 126
end repeat
repeat with i from 1 to valueindex - 1
key code 125
end set_button_item
Your email is never published nor shared. Required fields are marked *
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
CAPTCHA: five + = 12
Notify me of followup comments via e-mail
Subscribe without commenting E-Mail:
GUI Scripting: Sondertasten umstellen…
-- hubionmac.com 24.03.2011 (tested with 10.6.7)
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.keyboard"
tell application "System Events"
tell process "System Preferences"
click button 1 of tab group 1 of window 1
set curOpt to (get value of pop up button 3 of sheet 1 of window 1)
set curCmd to (get value of pop up button 4 of sheet 1 of window 1)
click pop up button 4 of sheet 1 of window 1
my set_button_item(1)
click pop up button 3 of sheet 1 of window 1
my set_button_item(2)
click pop up button 2 of sheet 1 of window 1
my set_button_item(3)
click pop up button 1 of sheet 1 of window 1
my set_button_item(4)
delay 0.25
keystroke return
end tell
end tell
quit
end tell
on set_button_item(valueindex)
tell application "System Events"
tell process "System Preferences"
repeat with i from 1 to 5
key code 126
delay 0.25
end repeat
repeat with i from 1 to valueindex - 1
key code 125
delay 0.25
end repeat
keystroke return
end tell
end tell
end set_button_item