Re: communicating with other applications
Re: communicating with other applications
- Subject: Re: communicating with other applications
- From: email@hidden
- Date: Sat, 22 Jun 2002 07:42:06 -0500
Well.. as usual there is no cut and dried answer to the question (it
being a bit vague) ..
However, I fail to see why NSTask/NSPipe combination to talk to a
generic application is bad..
Doesn't the remote application have to be "Applescript" aware in order
to use AppleScript??
NSWorkspace could be interesting if you just wanted to launch
APPLICATIONS.. however, if you want
to interact say with "bc" (or some such animal) that doesn't really
help..
So... I guess... the "correct" answer is:
1) Use AppleScript/AppleEvents if you can
2) Use NSWorkspace if that is what you want to do
3) use DO if you control both sides and that makes sense..
4) use NSTask/NSPipe for a generic lower level interaction ..
5) Use NSPort etc. if the other side is a TCP/IP aware thing :-)
etc. etc. etc.
-SJM
On Saturday, June 22, 2002, at 07:21 AM, David Remahl wrote:
Look at NSTask.. that is more than likely what you want..
I disagree...
Cheers
-SJM>> Hello,
I have a Cocoa app and would like to add functionality
so the app can communicate with other applications on
the same computer and the OS (opening other
applications ...etc.). What is the best way to go
about doing this?
AppleScript/AppleEvents. Definitely. If you just want to open an app,
then
NSWorkspace or LaunchServices may be what you want. If you need to
communicate with an application you created yourself (or have in-depth
knowledge of) you should use Distributed Objects or Mach ports for
maximum
efficiency (although AE will do just as well).
1) Invoke an AppleScript from the Cocoa app? If so,
how is this implemented? Would I need to create an
AppleScript Studio application rather than a Cocoa
application (all of the code is currently writing on
Objective C)?
You can use the class NDAppleScriptObject (please search the archives)
or
NSAppleScript (which is part of Jaguar).
2) Send Apple Events from the Cocoa app?
Just use the Carbon calls.
/ David
_______________________________________________
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.