c++macoscocoaappleevents

Handling Apple events from console app on Mac


Please give me some hints about how to work and, more practically, handle Apple events from raw console application written in C++ on Mac. I know that there is huge infrastructure for this purpose in Cocoa but as I think this is only a wrapper. May be it's impossible?


Solution

  • There is C API for it:

    http://developer.apple.com/legacy/mac/library/#documentation/Carbon/Reference/Open_Scripti_Architecture/Reference/reference.html

    and

    http://developer.apple.com/legacy/mac/library/#documentation/Carbon/Reference/Apple_Event_Manager/Reference/reference.html

    Overview:

    http://developer.apple.com/legacy/mac/library/#documentation/AppleScript/Conceptual/AppleEvents/intro_aepg/intro_aepg.html

    But as you can see that Apple considers this as legacy nowadays, so for a new project, using the Objective-C APIs might be the better choice.