Adding AppleScript to an app used to be quite clunky. There were a bunch of classes encapsulating AppleScript verbs and so on that you had to wire up. About ten years ago, they added some reflection-based things that let you just expose an Objective-C class as a scripting interface. They also did the converse and made it easy to use AppleScript interfaces from Objective-C, which made it easy for one app to drive another without needing to embed AppleScript code as text that Objective-C code would then pass to another parser.
@david_chisnall @glyph @beka_valentine
I recently learned Chrome has AppleScript support, and was disappointed that it doesn't seem to support anything similar on Windows.
I think if you expose IDispatch COM objects you can probably build something similar, but of course I'm sure it's a huge pain of fighting with legacy technology.
@KevinOfComputer @glyph @beka_valentine
Windows DCOM is closer to Distributed Objects in the NeXT world. I think one of the largest mistakes Apple made with OS X was not reimplementing AppleScript over DO, which means that you have two completely unrelated ways of vending an object to external users (three once they introduced XPC) in the core system abstractions.
I did some prototyping ages ago in GNUstep with the tooling I wrote for writing scripting languages that shared an object model with ObjC and using DO as a building block for scripting. It worked quite nicely at the time.