如何在可访问性检查器描述为“<空描述"的窗口中引用对象?(群展) [NSBox]"在 Applescript 中? [英] How do I refer to an object in a window whose Accessibility Inspector description is &quot;&lt;empty description&gt; (group) [NSBox]&quot; in Applescript?

查看:30
本文介绍了如何在可访问性检查器描述为“<空描述"的窗口中引用对象?(群展) [NSBox]"在 Applescript 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试与 iTunes导出库.."对话框交互.

I am trying to interact with iTunes "Export Library.." dialog.

我尝试了为窗口 winName 的第 1 组的弹出按钮 1 的菜单 1 的每个菜单项设置选项",但它说第 1 组"是无效索引?

I tried "set choices to every menu item of menu 1 of pop up button 1 of group 1 of window winName" but it says "group 1" is an invalid index?

相关代码如下:(调用参数为:iMac-8GB"、iTunes"、iTunes"、false"

Here's the relevant code: (the call parameters are: "iMac-8GB", "iTunes", "iTunes", false"

on handleDir(dir, winName, appName, createIt)
    local foundIt, ndx
    set foundIt to false
    if winName is not "" then
        tell application "System Events" to tell process "iTunes"
            set choices to every menu item of menu 1 of pop up button 1 of group 1 of window winName

推荐答案

使用此代码,修改为专门针对 iTunes':

Using this code, modified to specifically target iTunes':

tell application "System Events"
    tell front window of (first application process whose frontmost is true)
        set uiElems to entire contents
    end tell
end tell

来自对 使用的回答AppleScript 列出窗口中所有 UI 元素的名称(GUI 脚本)

我发现 Applescript 将 NSBox 称为大纲".

I discovered that a NSBox is referred to as an "outline" by Applescript.

这篇关于如何在可访问性检查器描述为“<空描述"的窗口中引用对象?(群展) [NSBox]"在 Applescript 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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