如何在applescript中获取选定的ui元素?

如何在applescript中获取选定的ui元素?,applescript,Applescript,我正在尝试为没有字典的应用程序创建脚本。如何获取所选列表项 我需要这样的东西 告诉应用程序“系统事件” 告诉流程“流程” 获取窗口1的拆分器组1的列表1的选定项 结束语 结束通话 _ 从列表1中选择…失败,出现1700错误(无法转换为字符串)不幸的是,每个特定元素(静态文本UI元素)的选定属性似乎无法访问。 执行以下操作: activate application "SongOfGod_1_2" --(this line above is just to make sure -- we don

我正在尝试为没有字典的应用程序创建脚本。如何获取所选列表项

我需要这样的东西

告诉应用程序“系统事件”
告诉流程“流程”
获取窗口1的拆分器组1的列表1的选定项
结束语
结束通话

_


从列表1中选择…
失败,出现1700错误(无法转换为字符串)

不幸的是,每个特定元素(静态文本UI元素)的选定属性似乎无法访问。 执行以下操作:

activate application "SongOfGod_1_2"

--(this line above is just to make sure
-- we don't miss anything by not having the app frontmost;
--for many commands it is unnecessary)

tell application "System Events"
    tell process "SongOfGod"
        properties of static text 2 of list 1 of splitter group 1 of group 1 of splitter group 1 of window 1
    end tell
end tell
返回:

{class:static text, minimum value:missing value, orientation:missing value, position:{595, 259}, accessibility description:"2. And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.", role description:"text", focused:false, title:missing value, size:{1605, 18}, help:missing value, entire contents:{}, enabled:true, maximum value:missing value, role:"AXStaticText", value:missing value, subrole:missing value, selected:missing value, name:missing value, description:"2. And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters."}
如果滚动到那里,您会注意到
selected
属性返回
缺少的值
,这意味着您无法确定它是否被选中。我还尝试了
聚焦
,但不起作用。也不要单击
选择
工作。试图获取包含它的列表的
selected
属性也不起作用


很抱歉,你显然无法从这个应用中得到你想要的东西

如果不知道目标应用程序、其版本以及您将要实现的目标,就无法回答这个问题。GUI脚本完全依赖于上下文。@vidian song of god。我想知道女巫诗被选中了