Macos 如何在AppleScript中执行AXShowMenu后获取上下文菜单
我的代码是这样的Macos 如何在AppleScript中执行AXShowMenu后获取上下文菜单,macos,applescript,Macos,Applescript,我的代码是这样的 tell button 1 of window 1 perform action "AXShowMenu" delay 0.2 end tell 菜单显示后,如何获取菜单?非常感谢这是下拉按钮菜单1中的项目: tell button 1 of window 1 click delay 0.2 get every menu item of menu 1 --click menu item "name" of menu 1 end
tell button 1 of window 1
perform action "AXShowMenu"
delay 0.2
end tell
菜单显示后,如何获取菜单?非常感谢这是下拉按钮菜单1中的项目:
tell button 1 of window 1
click
delay 0.2
get every menu item of menu 1
--click menu item "name" of menu 1
end tell
我使用Accessibility Inspector查找上下文菜单的父项是button 1,但是,当我使用get button 1的每个ui元素时,总是得到空列表。您确定它是button 1吗?按钮1-3实际上是窗口左上角的红色、黄色和绿色。代码是简单的测试,我的意思是如何获得上下文菜单,我尝试了很多方法,但都失败了,希望有人能帮助我,我的电子邮件在gmail.com上是新的,给我发电子邮件,我可以给你我所有的代码