2012-09-20 36 views
0

来查找窗口中的元素。我想访问对话框/窗口中的元素。我试过下面的代码。无法在applescript中使用新的applescript

tell application "System Events" 
set procs to processes 
set windowName to {} 
repeat with proc in procs 
    try 
      if exists (window 1 of proc) then 
     repeat with w in windows of proc 
      if w's name contains "App Name" then 
       copy w's name to the end of windowName 
       copy properties of w to the end of windowName 
      end if 
     end repeat 
      end if 
    end try -- ignore errors 
end repeat 
end tell 
return windowName 

,但我只能从窗子爬了4个元素: 1.关闭 2.Minimize 3.Maximize 4.window标题

从窗口/ dilog里面没有。

任何人都可以帮我解决这个问题吗?

回答

0

您只问窗口的名称和属性。如果你想要它的元素,那么请求它的“UI元素”。

+0

也尝试过UI元素,它也返回相同的4个元素。 – Shashank