GUI Scripting: Sondertasten umstellen…

Ich habe immer noch nicht viel für GUI-Scripting übrig, aber wie sonst könnte man die Sondertasten per Skript 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

Leave a Reply