In AppleScript, how can I list an object's "metadata" (or what's the right terminology in AppleScript?), and how do I get "type" metadata for an object?
In other word, how can I implement these functions:
return ??? -- returns "window" if x is a window
repeat ??? -- enumerate through "name", "(what is it for type)", etc.
The first function can be accomplished with
on GetType(x) return class of x as text end GetType
Metadata are properties in AppleScript, however properties are not required and the type of properties is a record (dictionary) which cannot be simply enumerated in a repeat loop.