I want to write code in appscript.rb equivalent to Applescript:
tell App "TextEdit"
properties of front window
end tell
Trying
te = app("TextEdit")
puts te.windows[1].properties
returns the list of property names but no value.
Thanks to answer.
The Ruby Appscript equivalent to AppleScript’s
propertiesreference has a trailing underscore:properties_. You will also need to usegetto execute the query:The result of the last expression will be an instance of Ruby’s Hash class.
The title of your question mentions
UI_element, which might indicate that you are interested in theUI elementsobjects available from System Events.