Retrieving all UI Elements from window with Applescript
Hi All..
I want to retrieve all the ui elements from one of the window in runtime with Applescript.
The problem is in order to get the elements of the particular window i need to pass thru the hierarchy like UI element 1 of scroll area 1 of window 1 etc..
How do i get the hierarchy at the runtime??
For eg: if the hierarchy level is 3, i can get the UI elemets like.. ui elements of ui elements of ui elements of window 1.. this works fine
but i want to repeat the same statement in loop, till i get some elements, how do i achieve the same??
I tried the below code its not working for me... Pls suggest
set allButtons to {}
set i to 0
tell application "System Events"
tell process "Install Adobe Reader"
set num to count of UI elements of window 2
set element to every UI element of window 2
repeat with i from 0 to num
if class of element is button then
return true
else
set element to (a reference to UI elements of element)
set num to count of UI elements of element
end if
end repeat
end tell
end tell
Mac OS X (10.7.4)