0
tell application "System Events"
tell application "System Preferences"
    activate
    set current pane to pane "com.apple.preference.displays"
    set theWindows to windows
    set win2 to item 2 of theWindows
    tell win2
        set index to 1
        set visible to false
        set visible to true
    end tell
    set value of combo box 1 to "90°"
end tell
end tell

I'm trying to change the Rotation of the External Screen via Applescript, but I do not find out how to access this dropdown menu. Google seems to give me a lot about combo box and pop menu, but under Lion at least all this stuff doesn't work.

4

1 に答える 1

0

これは10.8でうまくいきました。

tell application "System Preferences"
    reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences"
    tell pop up button 1 of tab group 1 of window 1
        click
        click menu item 3 of menu 1
    end tell
end tell
于 2012-09-10T23:48:42.917 に答える