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

This entry was posted in OS X, Useful Snippets and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

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>

CAPTCHA:


five + = 12

Subscribe without commenting

  • Seite übersetzen:


    Paypal for Pizza:




  • Kategorien


  • Letzte Kommentare

    • Niklas: Vielen Vielen Dank! So klappt es!
    • hubi: Servus Niklas, ich habe mir den Quellcode noch einmal angesehen und habe nun unter 10.7.3 einen Weg gefunden...
    • Niklas: Klingt super das Script. Leider bekomm ich immer folgende Fehlermeldung: error “„Mail“ hat einen Fehler...
    • Jürgen: Hallo Hubi, beim Abfragen von Kennworten gibt es noch eine böse Falle: Das Format, in dem security antwortet,...
    • hubi: Am einfachsten Du öffnest im AppleScript-Editor mal das Funktionsverzeichnis (unter Ablage) von iTunes. Ein...