使用AppleScript旋转显示器(蒙特雷)



脚本和设置窗口

错误

如何单击";漫游:"按钮

tell application id "com.apple.systempreferences"
reveal pane id "com.apple.preference.displays"
activate -- This used to not be necessary
end tell
tell application id "com.apple.systemevents" to tell ¬
process "System Preferences" to tell window 1
tell (a reference to pop up button -1 of group 1)
my (wait for it)
perform action "AXShowMenu"
tell menu 1
my (wait for it)
pick menu item 1
end tell
end tell
end tell
tell application id "com.apple.systempreferences" to quit
to wait for UIElementRef
tell application id "com.apple.systemevents" to repeat 10 times
if the UIElementRef exists then return
delay 0.5
end repeat
error from UIElementRef
end wait

您可以更改以下行:

pick menu item 1

将索引号1替换为所需的菜单项编号。

最新更新