Re: COM on mac
Re: COM on mac
- Subject: Re: COM on mac
- From: Sheehan Olver <email@hidden>
- Date: Mon, 13 Jan 2003 17:54:58 -0600
There are a couple other options besides AppleEvents that other people
have mentioned. It depends on the need. If you want to communicate
between two cocoa apps that you are working on (or that are documented)
you could use Distributed Objects, which are really easy to use. You
could even use low level unix IPC, such as sockets and shared memory.
Of course this wouldn't work for your Microsoft Word example. Another
option is that certain program will open URLs. In my Address550, I
hooked up double clicking a contact to open that same contact in
AddressBook.app. The line I used was:
NSString *uniqueId = [person uniqueId];
NSString *urlString = [NSString
stringWithFormat:@"addressbook://%@", uniqueId];
[[NSWorkspace sharedWorkspace] openURL:[NSURL
URLWithString:urlString]];
Again, Word probably doesn't support any URLs like this. Finally, if
what you want is a wrapper to another program, you can use AppleScript
Studio. It's basically the same as launching AppleScripts from an
Objective-C app, but makes it simpler. An example of a program that
wraps Mail.app, take a look at
/Developer/Examples/AppleScript Studio/Mail Search/
Of course AppleScript is not designed for speed, so if speed is a
requirement, use AppleEvents or Distributed Objects. To take a look at
the available commands a given program, say Microsoft Word, is
accessable by AppleEvents, choose File > "Open Dictionary..." in
Project Builder.app, then select the program from the list. A window
with all the commands shows up. That way you can find out if what you
are looking for is available.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.