Skip to content

Instantly share code, notes, and snippets.

@LeZuse
Last active August 19, 2019 17:44
Show Gist options
  • Save LeZuse/b3f9f265cbcdf91303cfe73c3d05d51c to your computer and use it in GitHub Desktop.
Save LeZuse/b3f9f265cbcdf91303cfe73c3d05d51c to your computer and use it in GitHub Desktop.
Inspecting the UI elements in AppleScript
# Source: https://macscripter.net/viewtopic.php?pid=189593#p189593
# example: inspecting the contents of the Notes window
tell application "System Events" to tell process "Notes"
class of UI elements
tell window 1
class of UI elements
tell splitter group 1
class of UI elements
# get name of button 1
tell splitter group 1
class of UI elements
tell group 1
class of UI elements
tell scroll area 1
class of UI elements
tell table 1
class of UI elements
tell row 1
class of UI elements
class of UI elements of UI element 1
value of every static text of UI element 1
# ...
get properties
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment