How to make app (Apple-)scriptable via simple cmd interface?

I like to provide a command interface to my Mac-only Xojo app.

Ideally, I’d provide AppleScripting by implementing a full suite with objects and all. However, this is too much work for me right now.

It would be much easier to implement something more like what the Xojo IDE does where the app receives textual commands via a single channel and then sends back results on the same channel.

The Xojo IDE accomplishes that via a Socket connection, but I like to try the same by using a single scripting command, such as “executeCommand”, which takes a String. The results should be able to have different types, mainly text, picture and file reference, and possible an array of those.

Has anyone done something similar? I’m especially interested in getting help with creating the various response descriptors.

Sigh. Nevermind. Just look here, stupid old man: http://www.tempel.org/RB/AppleEvents

I would never say that :frowning:

Well, it’s how I feel. I keep forgetting about my own stuff so often I wonder if I’m already suffering from dementia.

BTW, I’ve also updated Thomas Reed’s original code from RBDeveloper 1.5 & 1.6 to work on Intel Macs (the code had some issues with Little Endian systems).

For the record, I’ve developed a quite smart wrapper to make a Xojo app scriptable with Applescript. It is based on “Cocoa Scripting”, which makes handling objects much easier than with the old AE-based API.

My wrapper handles all the NS… base classes for you, so you do not have to mess with Cocoa objects at all. Contact me if you’re interested.

Demo app here: http://files.tempel.org/RB/Scriptability/AppleScriptable-App.zip