How to log object properties in SenseTalk

368 Views Asked by At

What's the easiest way to log all the properties of an object in SenseTalk?

Like this C# example but for eggplant scripting?

1

There are 1 best solutions below

0
sphennings On BEST ANSWER

In sense talk objects are represented as propertyLists. You can iterate over the keys of an object using the exact same syntax as you would with a propertyList.

set mike to {current:["Mike and the Mechanics","Genesis"],previous:"Red 7"}

repeat with each item of keys(mike)
  put it & ": " & property (it) of mike
end repeat

// current: [Mike and the Mechanics,Genesis]
// previous: Red 7