单击UI未知元素: [英] Clicking an UI unknown element: I'm getting "missing value"

查看:84
本文介绍了单击UI未知元素:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是applescript的新手:

I'm a newbie in applescripting:

我使用UI浏览器来查找我要单击的流程的元素.我发现我想单击的元素是"UI元素10"

I've used UI Browser to find an element of a process I'd like to click. I've found that the element I wanna click is "UI element 10"

这是我随附的:

tell application "System Events"
    tell application process "nameofmyapp" to tell window 1
        click UI element 10
    end tell
end tell

但是它返回:缺少值".

But it returns: "missing value".

我该如何解决?

推荐答案

系统事件有时会在单击按钮时出现问题,主要是在非本地可可应用程序窗口中.那是你的情况吗?

System Events has problems sometimes clicking buttons, mostly on non-native cocoa application windows. Is that your situation?

即使不是,我也编写了一个命令行工具,使您可以单击鼠标.您可以在此处找到它.您可能想尝试一下.您必须按屏幕坐标单击事物,所以您必须以编程方式从系统事件"中获取按钮的屏幕坐标,然后添加一些像素以将坐标移至按钮的中间,然后使用我的工具单击它.我的网页上有一个示例AppleScript代码,可以为您提供一些帮助.

Even if it's not, I wrote a command line tool that allows you to perform mouse clicks. You can find it here. You might want to try it. You have to click things by screen coordinates so you'll have to programmatically get the screen coordinates of the button from System Events, and then add some pixels to move the coordinates to the middle of the button, then click it with my tool. There's example applescript code on my web page to give you some help.

这篇关于单击UI未知元素:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆