Is there a standard AppleScript construct to get only those properties of a class that are settable?
I ask because I’m writing a scriptable app, and I want to make it possible to use “make new … with properties X”, where X are properties fetched from another object of the same class. I do not want to use duplicate for this (because I do not want all the elements duped), so I am looking for a convenient way to copy just the top properties from an existing object to the new one.
Ideally, one should be able to write something like this:
set oldObject to ...
set oldProps to writeable properties of oldObject
make new myClass with properties oldProps
Of course, “writeable properties” is not a valid construct, and so the above leads to a syntax error.
But if I just used “properties”, that would include read-only props, and if I passed those to the “make” command, it would internally complain about trying to set read-only properties.
Any ideas how to solve this elegantly?
I can add new keywords, of course, but I first wanted to see if there are common ways to do that already.