tell application "System Events" to tell process "Finder"
set frontmost to true
keystroke "i" using {command down, option down}
tell window 1 to tell first scroll area
class of UI elements
log result --> {image, static text, static text, static text, static text, scroll area, UI element, static text, static text, static text, static text, static text, static text, static text, static text, static text, static text, static text, static text, static text, checkbox, checkbox, checkbox, UI element, static text, static text, static text, UI element, static text, text field, checkbox, UI element, static text, scroll area, UI element, static text, UI element, static text, static text, scroll area, button, button, menu button, checkbox}
tell first scroll area
class of UI elements
log result --> {text field}
tell first text field
--perform action "AXShowMenu"
name of its attributes
log result --> (*AXFocused, AXSelectedText, AXSharedFocusElements, AXInsertionPointLineNumber, AXPosition, AXNumberOfCharacters, AXEnabled, AXPlaceholderValue, AXSelectedTextRange, AXHelp, AXChildren, AXRole, AXParent, AXTopLevelUIElement, AXDescription, AXVisibleCharacterRange, AXValue, AXRoleDescription, AXSize, AXWindow, AXFrame, AXIdentifier*)
value of its attributes
log result --> (*false, missing value,, 0, 15, 108, 2, true, Ajouter des tags., 1, 0, missing value, text field 1 of text field 1 of scroll area 1 of scroll area 1 of window Infos sur tout quitter.app of application process Finder, text field 2 of text field 1 of scroll area 1 of scroll area 1 of window Infos sur tout quitter.app of application process Finder, AXTextField, scroll area 1 of scroll area 1 of window Infos sur tout quitter.app of application process Finder, missing value, éditeur de tag, 1, 2, , champ de texte, 390, 35, window Infos sur tout quitter.app of application process Finder, 15, 108, 405, 143, _NS:38*)
set value of its attribute "AXFocused" to true
class of UI elements
log result --> {text field, text field}
tell text field 1
set theValue to its value
log result --> "Orange"
set thePosition to its position
log result --> {17, 214}
end tell
click at thePosition
delay 0.2
class of UI elements
log result --> {text field, text field, scroll area}
tell first scroll area
class of UI elements
log result --> {table}
tell table 1
class of UI elements
log result --> {row, row, row, row, row, column}
tell row 2
class of UI elements
log result --> {UI element}
tell first UI element
its properties
log result --> (*class:UI element, minimum value:missing value, orientation:missing value, position:14, 171, role description:cellule, accessibility description:missing value, focused:true, title:missing value, size:390, 19, value:missing value, help:missing value, enabled:true, maximum value:missing value, role:AXCell, entire contents:, subrole:missing value, selected:false, name:Rouge, description:cellule*)
name of its attributes
log result --> (*AXRowIndexRange, AXEnabled, AXDescription, AXParent, AXChildren, AXSize, AXFocused, AXColumnIndexRange, AXRole, AXTitleUIElement, AXTopLevelUIElement, AXPosition, AXWindow, AXRoleDescription, AXSelected, AXFrame*)
value of its attributes
log result --> (*2, 2, true, missing value, row 2 of table 1 of scroll area 1 of text field 1 of scroll area 1 of scroll area 1 of window Infos sur tout quitter.app of application process Finder, image Rouge of UI element Rouge of row 2 of table 1 of scroll area 1 of text field 1 of scroll area 1 of scroll area 1 of window Infos sur tout quitter.app of application process Finder, static text Rouge of UI element Rouge of row 2 of table 1 of scroll area 1 of text field 1 of scroll area 1 of scroll area 1 of window Infos sur tout quitter.app of application process Finder, 390, 19, true, 1, 1, AXCell, static text Rouge of UI element Rouge of row 2 of table 1 of scroll area 1 of text field 1 of scroll area 1 of scroll area 1 of window Infos sur tout quitter.app of application process Finder, missing value, 14, 171, window Infos sur tout quitter.app of application process Finder, cellule, false, 14, 171, 404, 190*)
class of UI elements
log result --> (*image, static text*)
tell first static text
--name of its attributes
--log result --> (*AXSelectedTextRange, AXNumberOfCharacters, AXEnabled, AXParent, AXSize, AXFocused, AXChildren, AXPlaceholderValue, AXRole, AXTopLevelUIElement, AXInsertionPointLineNumber, AXHelp, AXValue, AXPosition, AXWindow, AXRoleDescription, AXVisibleCharacterRange, AXSelectedText, AXFrame, AXIdentifier*)
--value of its attributes
--log result --> {{1, 0}, 5, true, UI element "Rouge" of row 2 of table 1 of scroll area 1 of text field 1 of scroll area 1 of scroll area 1 of window "Infos sur tout quitter.app" of application process "Finder" of application "System Events", {356, 17}, false, {}, missing value, "AXStaticText", missing value, 0, missing value, "Rouge", {40, 171}, window "Infos sur tout quitter.app" of application process "Finder" of application "System Events", "texte", {1, 5}, missing value, {40, 171, 396, 188}, "_NS:29"}
set {x1, y1} to its position
# I didn't found an other way to select a tag
do shell script "/Users/admin/bin/cliclick c:" & x1 & "," & y1
end tell
--click at itsPosition -- seems to do nothing
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
Yvan KOENIG running El Capitan 10.11.3 in French (VALLAURIS, France) mardi 26 janvier 2016 12:23:49