One line summary - I'm looking for a way to get AppleScript itself to reveal the name it expects a specific piece of window content (UI element) to be referred to as in a "tell" statement.
How do I get AppleScript to list the name it wants me to use to refer to a window's contents?
for example I can say tell current application to tell its front window's list 1 to ...
I'm trying to find out the term like "list 1" for all of the window's contents so I can cross-reference it with the list from Accessibility Inspector..
I tried this code but the first line generates an error saying "error "Can’t make names of «class ects» of window 1 of «class prcs» \"iTunes\" of application \"System Events\" into type string." number -1700 from names of «class ects» of window 1 of «class prcs» "iTunes" to string"
tell application "System Events" to tell process "iTunes" to set elementNames to the names of the entire contents of its front window as string
tell application "TextEdit"
activate
make new document at the front
set the text of the front document to elementNames
set WrapToWindow to text 2 thru -1 of (localized string "&Wrap to Window")
end tell