【发布时间】:2015-04-17 12:43:18
【问题描述】:
我想创建一个 AppleScript 来单击菜单,但我无法使用我使用的任何脚本,这是我想要的菜单:
ELEMENT :
Role : menu item
Title: "sign in As..."
Description :
Help:
Application: SytemUIServer
ELEMENT PATCH (starting at leaf element):
menu Item "Sign in As..." (menu item 12)
menu (menu 1)
menu extra (menu bar item 2)
menu bar (menu bar 1)
application "SystemUIServer"
所以我做了一些脚本,最后一个是
ignoring application responses
tell application "System Events" to tell process "SystemUIServer"
click menu bar item 2 of menu bar 1
end tell
end ignoring
do shell script "killall System\\ Events"
delay 0.1
tell application "System Events" to tell process "SystemUIServer"
tell menu item 12 of menu 1 of menu bar item 2 of menu bar 1
click
end tell
end tell
我也只是意识到位置可以改变(有时我想点击的项目是菜单项 12 有时是 10 等等)
【问题讨论】:
-
ELEMENT:角色:菜单项标题:“登录为...” 描述:帮助:应用程序:SytemUIServer ELEMENT PATCH(从叶元素开始):菜单项“登录为...” (menu item 12) menu (menu 1) menu extra (menu bar item 2) menu bar (menu bar 1) application "SystemUIServer"
标签: select applescript menubar