Program Linking

Richard Gaskin ambassador at FourthWorld.com
Tue Mar 12 20:26:01 EST 2002


Ben Rubinstein writes:

> on 12/3/02 6:01 PM, Richard Gaskin at ambassador at FourthWorld.com wrote:
> 
>> If you need your app to communicate with another Mac app using AE
>> specifically, you can probably do just about anything you'd need with either
>> Rev's built-in support for 'dosc' ("do script", for commands) and 'eval'
>> ("evaluate", for functions) Apple events, or with AppleScript.
> 
> Absolutely - but if you want to use that functionality to do something to
> another program, allowing the user to select the target app, you need
> 'answer program'.

True, true.  

But given what we got, and looking at OS X's future in TCP sockets, maybe
there's an opportunity to solve the problem of inter-process communication
and enjoy all the benefits of sockets at the same time.

If the communication is between multiple copies of a Rev-based app, couldn't
you broadcase a request for IP and process ID and have those returned to
present in a dialog?   If we can get the details of that worked out we'd
have something far more useful than "answer program" in some respects, and
it would work on any TCP network running on any modern computer.

Anyone got a URL handy for info on sending UDP broadcasts?

Of course, if the communication is between a Rev-based app and something
else, you're limited to what that something else provides.  You could
probbly hire someone to write an XFCN for you, but given that it would
likely be obsolete with a future version of the CarbonLib it may just be a
matter of patience (let's hope).

 
>> Other programmers have told me that the "answer program" API is screwy under
>> OS 9, which may be why it's not more widely supported.  I don't recall
>> seeing it in anything but SuperCard, HyperCard, and an old stats graphing
>> program called Spyglass many years ago, and if there's a newer app that
>> provides this I'd be interesting in learning about it.
> 
> First I've heard of it - do you have any more info on this?  I've
> experienced no problems with it on OS 9 or before.  You wouldn't expect to
> see it in any apps other than those that support users creating applescripts
> to control other apps (ie development environments like HC, SC, Rev, Script
> Debugger, FaceSpan, Frontier... all of which support it.

My post wasn't specific enough.  OS 9 per se isn't the problem, it's the
still-not-quite-finished-yet CarbonLib.  In my limited understanding, apps
that don't use CarbonLib should have no problem, but those that do are outta
luck for now.

I don't work much at the OS API level anymore (strongly prefer staying
closer to the user experience with scripting languages like Rev), but a pal
of mine who went to two of Apple's Carbon Kitchen events tells me that in
the latest headers he has (Universal Headers 3.4.1) the call to IPCListPorts
is still absent.

The "answer program" dialog is brought up by the PPCBrowser API, which in
turn uses IPCListPorts to obtain a list of connectable programs.   As it was
explained to me, there are four types of process IDs in the system and the
type used by IPCListPorts was gone when they decided not to go forward with
AppleTalk.  According to the Apple engineer he spoke with, they are aware of
the importance of having at least an alternative API for this, and loosely
suggested that something addressing this might become availble around the
time of WWDC or hopefully not long after.   It may be in the more recent
headers, if you know anyone who has them they could check to see if
IPCListPorts has been restored.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Custom Software and Web Development for All Major Platforms
 Developer of WebMerge 1.9: Publish any Database on Any Site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list