Hmmm, The short answer is probably "no, not really ... but ..."
The real authority on this sort of question is Matt Neuburg. If you
don't have his book "AppleScript: The Definitive Guide", I would
recommend that you buy it - it is the essential AppleScript reference
book. He discusses this in his section on Records. He describes it as
"a big shortcoming of AppleScript" that there is "no good way to
obtain a list of the names of the items of a record".
You might look at Late Night Software's free List & Record Tools
scripting addition, here: <http://www.latenightsw.com/freeware/RecordTools/index.html
>. It says on that page: "One of AppleScript's major limitations is
that it cannot dynamically access items in records – record keys must
be known at compile time. The List & Record Tools scripting addition
provides a series of commands for accessing records in a dynamic
fashion." (Incidentally, as I am mentioning Late Night Software, if
you are not already using their application, Script Debugger, I would
strongly recommend that you do: far superior to Script Editor - the
essential AppleScript tool.)
Finally, if you are working in AppleScript Studio ... and you have
asked this question on the Studio mailing list ...
In AppleScript Studio an AppleScript Record is bridged to Cocoa's
NSDictionary, and the key-value pairs of an NSDictionary can be
accessed. So, for instance, in Studio you can say:
set myRecord to {a:1, b:2} --> result: {a:1, b:2}
set allValues to call method "allValues" of object myRecord -->
result: {1, 2}
set allKeys to call method "allKeys" of object myRecord --> result:
{"a", "b"}
Is there a way within an AppleScript script to get the properties of
an arbitrary record (i.e., one for which you don't know its
properties a priori)?
Both Smile's console and Script Editor's Result window do a fine job
of showing an arbitrary record's properties and values, but I don't
see a way to do the same thing within AppleScript.