Open a TextEdit document Select a bit of text Run the script
tell application "System Events" to tell process "TextEdit" set frontmost to true tell window 1 class of UI elements --> {scroll area, button, button, button, menu button, group, static text, static text} tell scroll area 1 class of UI elements --> {text area, scroll bar, scroll bar, UI element} tell text area 1 value of attribute "AXSelectedTextRange" --> {28, 68} set value of attribute "AXSelectedTextRange" to {28, 50} end tell end tell end tell end tell
Yvan KOENIG running Sierra 10.12.3 in French (VALLAURIS, France) mardi 21 mars 2017 14:07:53
|