Questo è uno "studio" -an  tentativo  - per trovare modi pragmatici per identificare e "usare" gli elementi dell'interfaccia utente di AS: 
 Il codice qui sotto funziona   in linea di principio   ma deve essere adattato ai singoli. caso (es .: trova   secondo   immagine). 
Sono  non un professionista IT  quindi mi scuso per una netta mancanza di codice "on error" -  Scusa!  
... né questo significava essere una "guida completa" su AppleScript, piuttosto un "diario di viaggio". 
  (BTW: AirBook, i7-3740QM, 8 GB. I loop ripetuti su "tutto il contenuto" potrebbero richiedere più di 70 secondi. 
Sistema: MacOS X High Sierra 10.13.6, Apple Applescript 2.7. I comandi possono variare con le versioni.)  
 Ho iniziato la mia ricerca qui a  Ask Different , i miei "risultati" qui sotto si applicano principalmente al thread: 
  Come conoscere il nome degli elementi dell'interfaccia utente utilizzando Accessibility inspector (o qualsiasi altro strumento)  
  1) How many˜˜ UI elements are there in a "Ask Different" window? …
"Frame":    tell application "System Events" to tell process "Safari"
                set frontmost to true
                set i to 0
Start:          set listItems to (entire contents of window 1 as list)
Next:           repeat with thisItem in listItems
                    set i to i + 1
                end repeat
            end tell
"Result" in
ScriptEditor:   951                -- display dialog ("UIElems:" & i)
               ¯¯¯¯¯
  How many˜˜ elements are there in which different classes? …    
Classes:    if (class of item i of listItems is static text) then
                set classCount to classCount +1    
            end if
¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯    
"Results" in ScriptEditor:
static text (376), group˜˜ (337), UI element (166), button (51),
radio button (12), menu button (6), image (2)
(1 inst. each:) toolbar, scroll area, scroll bar, text area, text field, 
tab, checkbox, splitter group, splitter    
 (~~ Il "testo statico" che stai leggendo è alla fine di questa gerarchia "superiore": 
   Group> WebArea> ScrollArea> Group> Group> TabGroup> SplitterGroup> Window    
Diversi livelli contengono real400 elementi reali:   ogni   paragrafo & bullet point è uno StaticText!)
≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ 
  2) How to identify e.g. those 2 images within 951 UI elements & what to do:    
 (Da qui in poi solo parti di codice diverse, ad esempio "Successivo" vengono pubblicate; _ / ¯ = interruzione di riga.) 
Next:       set imgNums to {}
            repeat with thisItem in listItems
                set i to i + 1
Then:           if (class of item i of listItems is image) then
                    set imgNums to imgNums & i
            end repeat
            return imgNums    _/¯    end tell
¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯    
"Result" in
ScriptEditor:   {111, 255}     (≈ 70 sec.! Searching 951 items is tedious…)
                ¯¯¯¯¯¯¯¯¯¯
  … or just "context" the first …      (≈ 7 sec.!)
Next:           if (class of item i of listItems is image) then exit repeat
            end repeat
Then:       tell thisItem to perform action "AXShowMenu"    _/¯    end tell
 ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ 
  3) How to get at AppleScript's "verbal description" of a UI element?
Next:       repeat with thisItem in listItems    _/¯    set i to i + 1
Then:           if (class of item i of listItems is image) then
                    return (item i of listItems as list)
                    exit repeat
                end if    _/¯    end repeat    _/¯    end tell
¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯    
"Result" for image 1 in ScriptEditor:
image 1 of group 15 of group 6 of UI element 1 of scroll area 1 ¬
of group 1 of group 1 of tab group 1 of splitter group 1 of window ¬
"applescript - How to know the name of UI elements using Accessibility ¬
inspector (or any other tool) - Ask Different" of application process ¬
"Safari" of application "System Events"
¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯    
[Last three lines may be shortened to "window 1" – it's still in front …]
 - che è questa immagine ...  ...delladiscussionesopramenzionata.≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
...delladiscussionesopramenzionata.≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
4)Whichattributesarepossibleforanelement,whicharefactualproperties?
Then:if(classofitemioflistItemsisimage)then¬return(nameofattributesofthisItemaslist)¯¯¯¯¯¯¯¯¯¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯¯¯¯¯¯¯¯¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯¯ ¯ ¯"Result" for "attributes" in ScriptEditor:
"AXFocused", "AXAccessKey", "AXTitle", "AXElementBusy", "AXPosition", ¬
"AXLinkedUIElements", "AXSelected", "AXLanguage", "AXStartTextMarker", ¬
"AXEnabled", "AXEditableAncestor", "AXHighestEditableAncestor", ¬
"AXVisited", "AXDOMIdentifier", "AXHelp", "AXURL", "AXChildren", "AXRole", ¬
"AXParent", "AXSelectedTextMarkerRange", "AXTopLevelUIElement", ¬
"AXDOMClassList", "AXSubrole", "AXDescription", "AXFocusableAncestor", ¬
"AXValue", "AXBlockQuoteLevel", "AXRoleDescription", "AXSize", "AXWindow", ¬
"AXEndTextMarker", "AXFrame"
  Which are the factual properties of "image 1"?
Next:           if (class of item i of listItems is image) then ¬
                return (properties of thisItem as list)
¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯    
"Result" for "properties" in ScriptEditor:
missing value, m.v, {382, 790}, image, "enter image description here", ¬
"Bild", false, "", {241, 118}, "", {}, true, m.v., "AXImage", "", m.v., ¬
false, m.v., "enter image description here"
 Ovviamente le proprietà fattuali non corrispondono direttamente agli attributi (da 19 a 32). 
  But some attributes actually can return values if asked directly:
Then:       end repeat
            return value of attribute "AXFrame" of thisItem  _/¯  end tell
¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯    
"Result" for "AXFrame" in ScriptEditor:   {382, 790, 623, 908}
  Which property is assigned to which attribute? (For exact "AX…" name, see appendix!)
  ... easy solution, found on Apple's developer pages:
Next:       if (class of item i of listItems is image) then
                tell item i of listItems to properties
¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯    
"Result" for "Bild" in ScriptEditor:    
minimum value:missing value, orientation:m. v., position:{382, 790}, ¬
class:image, accessibility description:"enter image description here", ¬
role description:"Bild", focused:false, title:"", size:{241, 118}, ¬
help:"", entire contents:{}, enabled:true, maximum value:m. v., ¬
role:"AXImage", value:"", subrole:m. v., selected:false, name:m. v., ¬
description:"enter image description here"    
 Bene, apparentemente le "proprietà" dei comandi semplici di Apple restituiscono anche termini che sono effettivamente di livello superiore, come " classe : immagine" e " intero contenuto : {}" . 
Se sei interessato ad apprendere quali proprietà sono assegnate a quali attributi effettivi prova la "soluzione appendice" (ad es. > "AXFrame: {382, 790, 623, 908}").
≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ 
  
- Which "actions" belong to an element (AXPress, AXShowMenu…) ?
 I DuckDuckGo [ogle] 'd (DD'went?) e ho trovato un elenco di  "AXActionConstants" su Apple sito : 
  "AXShowMenu"  "AXPress"  "AXCancel"  "AXConfirm" 
  "AXDecrement"  "AXIncrement"  "AXShowAlternateUI"  "AXShowDefaultUI" 
  "AXPick" Scegli un UIElement, come la voce di menu 
  "AXRaise" Fa sì che una finestra diventi il più in primo piano possibile 
  "AXZoomWindow" Consente di ingrandire una finestra in "dimensioni del desktop", ma  NON in "schermo intero" . 
       NEW! … found action "AXZoomWindow" through UIElementInspector°° © Apple Inc. 2010
. 
  
- How are menu items addressed best?    
 (presto aggiungerò la mia opinione / i miei risultati su questi restanti problemi). 
 ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ 
  
- How "different" are classes –and UI elements– in various apps? 
-  "TextEdit" è un esempio di "funzioni" minimaliste di una finestra dell'applicazione. (Sii consapevole che 
 le sue finestre di strumenti (Fonts ecc.) hanno elementi di interfaccia utente propri, molti di più rispetto all'app principale!)
-  La sua "barra" superiore è composta da 3 pulsanti colorati, un'immagine che rappresenta il documento, il titolo come testo statico e una piccola freccia in basso, un pulsante del menu. 
- 
 Oltre a questi ci sono (potenzialmente) 2 aree di scorrimento (destra e amp;
in basso) con barre di scorrimento, anche indicatori di valore (la loro dimensione), e
non ultimo il suo "contenuto", un'area di testo.  Classes of window 1 of TextEdit / Finder / iTunes:
set classNum to classNum & (class of item i of listItems)
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – 
"Result" for "TextEdit" (16):
button (7), scroll bar (2), scroll area, text area, value indicator, 
menu button, image, static text
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – 
"Result" for "Finder" window in list view with left area with 
"devices" etc. , 11 files (208):
UI element (49), static text (49), image (27), row (26), button (19),
text field (12), group (6), radio button (4), column (4), ...
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – 
"Result" for "iTunes" (26):
button (12), radio button (3), static text (3), pop up button (2), 
radio group (2), slider, value indicator, scroll area, text field
 
-   "Finder" nella visualizzazione elenco mostra icone e amp; strumenti (= immagini), i file hanno nomi, date ecc. (testo statico), gli strumenti sono anche pulsanti, i nomi dei file sono anche campi di testo (rinomina).  
-  "iTunes" (senza elementi TV "installati") ha 2 pulsanti di scelta rapida (1: musica, film, TV / 2: successivo, cronologia, testo del brano) più vari tipi di pulsanti di navigazione. 
-  Tutte queste applicazioni, tuttavia, hanno anche centinaia di voci di menu: menu, sottomenu, sotto-sotto-menu (TextEdit ≈ 350, Finder ≈ 430). 
 ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ 
A P P E N D I X
≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ 
  Older code to get at "assignations" – but returns exact name! ... THAT took some testing:*
Next:       if (class of item i of listItems is image) then
                repeat with name in (attributes of thisItem as list)
                    try
                        if value of name is "Bild" then exit repeat
                    end try
                end repeat    _/¯    exit repeat    _/¯    end if
            try
                i & k & item k of (name of attributes of thisItem as list)
            end try
¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯        
"Result" for "Bild" in ScriptEditor:    {111, 28, "AXRoleDescription"}
 (Incl.: # of UI element, # of attribute, name of attribute) 
¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯    
 ({382, 790} => AXPosition, {241, 118} => AXSize, "AXImage" => AXRole …)    
 Il try-block è necessario poiché alcuni attributi senza valore causano altrimenti errori. 
Questa ricerca sulla pagina di esempio ha richiesto 9 anni. (# 111) su  QUESTA pagina  ≈ 135 s. (# 767)!
≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈