我发现ui元素的某些按钮是隐藏的,仅当光标悬停在应用程序“ theApp”窗口的指定区域上时才会显示。
tell application "System Events" to tell process "theApp" to tell window 1
log (entire contents to UI element 1 as list)
end tell
作为上面的代码,仅当光标悬停在指定区域上时,“整个内容”列表才包含按钮。是否可以通过Applescript在不移动鼠标的情况下获取并单击它们?