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

我正在尝试通过 Applescript 更改外部屏幕的旋转,但我不知道如何访问此下拉菜单。谷歌似乎给了我很多关于组合框和弹出菜单的信息,但在 Lion 下,至少所有这些东西都不起作用。

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 回答