I am looking to interact with other applications from a D application (which can interop with C) through the Apple Events system without embedding AppleScript, JSX or the like. There are few documents on the subject of sending Apple Events from non-AppleScript applications, and I can't find any information on achieving this from a C application, let alone a D application. Is it possible, and if so, how?
Asked
Active
Viewed 143 times
0
-
Inter-operation between C and D should be easy to do (IIRC), so once you find a way to have C interact, D should be relatively straightforward. – Adalynn Jan 29 '18 at 15:07
1 Answers
0
Here’s the documentation for the C API for these events.
Unfortunately, that API is part of Carbon, which apparently doesn’t work anymore, since OS X 10.8. The same C API is now exposed to Objective C and Swift, and is still supported. E.g. AECreateDesc is the same, AEBuildAppleEvent becomes vAEBuildAppleEvent, and so on. See this page for documentation, you’ll want functions/structures that begin with AE.
Now you have another problem, how to interop between C/D and ObjC/Swift. If you’re OK using XCode, you can mix the languages in a single project, see this answer.

Soonts
- 20,079
- 9
- 57
- 130