Hi there!
I have been developing AmiModRadio (
https://chingu.asia/wiki/index.php?title=AmiModRadio) for the Amiga for quite a while now, and wanted to develop something similar for NeXTStep. Essentially, AmiModRadio controls module players via ARexx, an implementation of Rexx on Amiga computers, which most module players support.
I was wondering if something similar to ARexx exists on NeXTStep, and if not, what alternatives could be used to control other programs programmatically. For example, I currently play modules using either Paula or ModPlayer (both available here (
https://www.nextcomputers.org/NeXTfiles/Software/NEXTSTEP/Apps/Audio/)): is there a "standard" way to control such programs programmatically?
Thanks in advance! :)
The standard way on NeXTstep would probably be to do IPC using Mach messages, which are quite a bit more complex than ARexx, I think.
This book chapter (
https://www.nextop.de/NeXTstep_3.3_Developer_Documentation/OperatingSystem/Part1_Mach/02_Messages/Messages.htmld/index.html) is a starting point, I recommend Boykin's book "Programming under Mach" (ISBN 0-201-52739-1, but long out of print) for more details.
Hi Cuby!
Yes, I started reading about Mach messages... but I guess that a program must be designed/implemented with them in mind from the start to control it programmatically, right?
(Like, on Amiga, a program must open an ARexx port, listen to it, and implement code to react to any ARexx commands sent its way.)
Best!
Yes, you have to actively listen to Mach messages sent to your process.
In theory (I never tried this on NeXTstep) you might be able to force the OS to load a shared library listening to messages (perhaps using a separate cthread) into the application you want to control using DYLD_INSERT_LIBRARIES (the NeXT/OS X equivalent to LD_PRELOAD on Linux) and then benefit from dynamic method dispatch in Objective C to call methods in the original binary. But that's just a crazy idea and could be completely infeasible... though this article seems to explore similar ideas (
https://jon-gabilondo-angulo-7635.medium.com/how-to-inject-code-into-mach-o-apps-part-i-17ed375f736e).
Apple later introduced AppleScript and Automator in OS X to control applications using scripting (I think there was also some interface to Javascript), but IIRC these are derived from features in the old (pre OS X) Mac system software and were not available in NeXTstep.
Eclecticlight has a nice overview (
https://eclecticlight.co/2025/02/22/a-brief-history-of-scripting-the-mac/) of the history of OS X application automation.
Hi Cuby and thanks for your answer! :)
Very interesting, but probably beyond my capabilities!
I was thinking of an alternative: is it possible to generate UI events? Or programmatically control the mouse position and buttons?
Cheers!