在 UIElementInspector 中查看元素编号

发布于 2024-10-11 10:20:10 字数 430 浏览 3 评论 0原文

因此,当我查看 UIElementInspector 中的 UI 项时,我会看到类似 AXButton 的内容。太好了,现在我想对 AXButton 执行操作,但问题是我最终做了这样的事情:(是的,我实际上已经这样做了,愚蠢的我)

perform action "AXPress" of pop up button 2 of group 1 of group 1 of group 1 of group 3 of UI element 1 of scroll area 1 of group 2...

现在我必须手动尝试什么按钮什么组什么什么的,以便查看该 UI 项目所属的位置,以便我可以对其进行操作。我想知道是否有一些不那么笨拙的方法来查看我应该输入哪些数字,因为有时我什至无法找到某些 AXButton 手动隐藏的位置。

So when I look at a UI item in UIElementInspector, I see stuff like AXButton. Great, now I want to perform an action on that AXButton, but the problem is I end up doing something like this: (yes I have actually done this, stupid me)

perform action "AXPress" of pop up button 2 of group 1 of group 1 of group 1 of group 3 of UI element 1 of scroll area 1 of group 2...

Now I have to manually try out what button # of what group # of whatever in order to see where that UI item belongs so I can do stuff on it. What I'm wondering is if there's some less kludgey way of seeing what numbers I should put in, as sometimes I can't even find where some AXButton is hiding manually.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北城挽邺 2024-10-18 10:20:10

是的,UIElementInspector 很难使用。我不使用它,因为它对我来说太难了。我建议在此处尝试 UI 浏览器。

找到东西的确切路径要容易得多……但它不是免费的。查找内容的唯一其他方法是让 applescript 找到它。假设您想在窗口中找到一个标题为“Press”的按钮。你可以做这样的事情......

set theButton to first button of window 1 whose title is "Press"
click theButton

显然有时窗口中有组(和其他东西),按钮可能位于其中之一,所以你可能必须做这样的事情......

set theButton to first button of every group of window 1 whose title is "Press"
click theButton

我希望有所帮助。

Yep, UIElementInspector is difficult to use. I don't use it because it's too difficult for me. I'd suggest trying UI Browser here.

It's a lot easier to find the exact path to stuff... but it's not free. The only other way to find things is to let applescript find it. Suppose you wanted to find a button titled "Press" in a window. You could do something like this...

set theButton to first button of window 1 whose title is "Press"
click theButton

Obviously sometimes there's groups in a window (and other stuff), and the button may be in one of them, so you may have to do something like this...

set theButton to first button of every group of window 1 whose title is "Press"
click theButton

I hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文