Finding Control and Menu Items for use in AppleScript User Interface Scripting
Originally posted on Mac OS X Hints, this looks like gold for Apple Scripters. The main point of this script is to run an AppleScript that tells you the names of the different elements of an app.
An example:
"Pointing the code at ‘System Preferences’ with the ‘Desktop & Screens Saver’ pane open will return[…] this line describing the slider which controls the delay before the screen saver activates:"
slider 1 of group 1 of tab group 1 of window "Desktop & Screen Saver" of application process "System Preferences" of application "System Events"
Commenters have tried to improve the script further and also mention a script by Nigel Garvey over at Mac Scripter, who kindly provides an “improved” version of the script listing running applications.
The link above will get you there as well.