Get a list of properties of an object?

I’ve been scripting for a long time now but I don’t know the answer to this question. Is there any way to get a list of properties and the values of an object? Something like a foreach loop in php. foreach ($properties as $key->$value) {echo $key.“=”.$value} Or would that have to be a method in the application?

I ask because I’m trying to learn a new application that has a craptacular dictionary. Yeah, that’s not unusual but this one is really bad. I really can’t make much progress.

What techniques are people using to figure out how to script new applications? If there are no example scripts is trial and error the only way? Are there any tools or utilities out there to help (other than the dictionary)?


there are only two options

¢ read the dictionary
¢ trial and error

The problem is, for example

get properties of application "foo"

displays the properties in the result window, but not the elements (nor the commands)