Le 17/10/2014 à 20:34, Bill Cheeseman < email@hidden> a écrit :
Has anybody noticed the new Scripting Definition Suite in the System Events terminology dictionary in Yosemite? Any thoughts on what it’s good for?
Here’s an example script:
tell application "System Events" tell scripting definition tell scripting suite "Processes Suite" tell scripting class "UI element" get name of every scripting property end tell end tell end tell end tell
-- returns {"accessibility description", "class", "description", "enabled", "entire contents", "focused", "help", "maximum value", "minimum value", "name", "orientation", "position", "role", "role description", "selected", "size", "subrole", "title", "value”}
My understanding is that it's the list of the names of properties available in the record returned by get properties of an UI element.
Here is a sample script and the returned record :
activate application "TextEdit" delay 0.5 tell application "System Events" to tell process "TextEdit" keystroke "S" using {command down, shift down} delay 1 tell scroll area 1 of window 1 properties of scroll bar 1 end tell end tell
(* {minimum value:missing value,¬ orientation:"AXHorizontalOrientation",¬ position:{187, 924},¬ class:scroll bar, role description:"barre de défilement",¬ accessibility description:missing value,¬ focused:false,¬ title:missing value,¬ size:{595, 15},¬ value:0.5,¬ help:missing value,¬ enabled:false,¬ maximum value:missing value,¬ role:"AXScrollBar",¬ entire contents:{},¬ subrole:missing value,¬ selected:missing value,¬ name:missing value,¬ description:"barre de défilement"} *)
I’m puzzled because before Yosemite, I was never forced to insert a delay between the activate instruction and the tell application "System Events" … Without it, the given script duplicate its own window.
Yvan KOENIG (VALLAURIS, France) vendredi 17 octobre 2014 21:11:51
|