Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DannySmurf

macrumors 6502a
Original poster
Jul 7, 2005
628
0
Hey guys. This is a question for all the advanced Mac programmers here. I bought Synergy a while ago and it got me wondering how programs like this work. For those who don't know, Synergy controls iTunes from a little spot in the menu bar.

Of course, on Windows you'd do this through COM, but how is it done in OSX? Does each applciation need to expose some sort of IPC interface by itself for this kind of control to happen? Or is there something built into the OS?
 

gekko513

macrumors 603
Oct 16, 2003
6,301
1
I just browsed quickly through the developer reference for Interapplication Communication using Cocoa, and there seems to be a number of techniques available. XML-RPC and Soap, Distributed Objects and System Services. NSDistributedNotificationCenter also lets you send messages between tasks.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
DannySmurf said:
Hey guys. This is a question for all the advanced Mac programmers here. I bought Synergy a while ago and it got me wondering how programs like this work. For those who don't know, Synergy controls iTunes from a little spot in the menu bar.

Of course, on Windows you'd do this through COM, but how is it done in OSX? Does each applciation need to expose some sort of IPC interface by itself for this kind of control to happen? Or is there something built into the OS?

Probably via AppleScript.
 

csubear

macrumors 6502a
Aug 22, 2003
613
0
There is nothing like COM on OS-X.

COM on windows solves two problems

a) Late bound objects
b) RPC/IPC

OS X solves these problems diffrently

a) Obj-C
b) SOAP/XML-RPC/Traditional Unix IPC/Cocoa Notification Center

(edit)

And yes most stuff like that is done with apple script hooks exposed by the application.
 

Fukui

macrumors 68000
Jul 19, 2002
1,630
18
csubear said:
There is nothing like COM on OS-X.

COM on windows solves two problems

a) Late bound objects
b) RPC/IPC

OS X solves these problems diffrently

a) Obj-C
b) SOAP/XML-RPC/Traditional Unix IPC/Cocoa Notification Center

(edit)

And yes most stuff like that is done with apple script hooks exposed by the application.
Right, but dont forget they changed (united) the plug-in system under OS X to use a COM interface so that carbon and cocoa could use plugins from windows and vice-versa.
 

csubear

macrumors 6502a
Aug 22, 2003
613
0
Fukui said:
Right, but dont forget they changed (united) the plug-in system under OS X to use a COM interface so that carbon and cocoa could use plugins from windows and vice-versa.


??, not sure what you mean.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Fukui said:
Right, but dont forget they changed (united) the plug-in system under OS X to use a COM interface so that carbon and cocoa could use plugins from windows and vice-versa.

Can you post some documentation or examples of this? I'm fairly sure there is no generic plugins mechanism at all, it's up to the App developer to provide (beyond the system provided CFBundle/NSBundle help). Are you talking about a specific app?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.