I'm attempting to write a program in Objective C that plays a notification when a message is received, using the Scripting Bridge. I've managed to set up the compilation and linked the libraries correctly; I can use all the functions in the 'messages.h' file generated by Scripting Bridge. However, this does not include the ability to receive messages. In Applescript, this is handled by the 'Message Event Handler Suite', but this doesn't seem to have directly carried over through the Scripting Bridge.There don't seem to be any generated functions that correspond to the specific Applescript event handling for messages. How can I receive events and messages directed at the messages application, in an Objective C program?
Edit: I'm not sure if this helps at all, but in the Messages.h file, the MessagesApplication class seems to use the MessagesSuite category.
@interface MessagesApplication (MessagesSuite)
I have not been able to find any documentation or information about this category, so I have no idea if its actually related to the Message Event Handler Suite in Applescript.
Short answer: You can't receive Apple Events which belong to another application.