我正在尝试为没有字典的应用程序创建脚本。如何获取选定的列表项目?
我需要这样的东西
tell application "System Events"
tell process "process"
get selected item of list 1 of splitter group 1 of window 1
end tell
end tell
_
choose from list list 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
属性返回missing value
,这意味着您无法确定是否选择了它。我还尝试了focused
,这是行不通的。click
或select
也不工作。试图获取包含它的列表的selected
属性也不起作用。
您很遗憾地说,您显然无法从这个应用程序中获得想要的东西。