如何在可访问性检查器说明为“<空说明"的窗口中引用对象? (组)[NSBox]"在Applescript中? [英] How do I refer to an object in a window whose Accessibility Inspector description is "<empty description> (group) [NSBox]" in Applescript?
本文介绍了如何在可访问性检查器说明为“<空说明"的窗口中引用对象? (组)[NSBox]"在Applescript中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试与iTunes导出库.."对话框进行交互.
I am trying to interact with iTunes "Export Library.." dialog.
我尝试过设置窗口winName组1的弹出按钮1的菜单1的每个菜单项的选项",但是它说"group 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屋!
查看全文