[comp.sys.mac.hypercard] multifinder programming help

rjp@litp.ibp.fr (Paul ROY) (05/20/89)

I am rather new to Macintosh programming, and need some help.
Here is my problem. I want Hypercard and a command language
interpreter (let us call it A) work in a cooperative way. Namely,
Hypercard will be a front-end for hypertext documentation and
questioning the interpreter, and A will be the engine which
will interpret commands. Here is the idea: I introduce some piece
of text into an Hypercard card field, and press ENTER. I have a
XCMD which then places the string into the scrap. Then, A sees
that something has gone into the scrap, takes it, zeroes the scrap,
processes the text, and puts back the answer (a string) into the
scrap. I want Hypercard be notified of the answer and put it
into a special answer card field. Simple ?
Well, I have not yet read a lot of things about programming under
Multifinder, but I suspect that I should use suspend/resume events.
Three problems:
i) How can I "pass the hand" to another *specific* application ? Is
it true that a resume event will launch *next* application (maybe
the Finder) ?
ii) Is the scrap way of making applications communicate right ? I
heard of a new release of Mac OS with Inter Process
Communication, but I can't wait for it (6 months ?).
iii) When the command interpreter A runs, I want it to have the
maximum cpu time for processing the query.
P.S. I know how to write XCMDs/XFCNs, and the command
interpreter A has access to Mac traps, so can set an event loop.

Hope somebody will help...

*********************************
*  Jean-Paul ROY                *
*  CFAPIA - Universite Paris 6  *
*  Tour 25 (2eme etage)         *
*  4, place Jussieu             *
*  75252 PARIS Cedex 05         *
*  FRANCE                       *
*                               *
*  email: mcvax!inria!litp!rjp  *
*********************************

tom@wcc.oz (Tom Evans) (05/22/89)

In article <2165@litp.ibp.fr>, rjp@litp.ibp.fr (Paul ROY) writes:
> I am rather new to Macintosh programming, and need some help.
> Here is my problem. I want Hypercard and a command language
> interpreter (let us call it A) work in a cooperative way. Namely,
> Hypercard will be a front-end for hypertext documentation and
> questioning the interpreter, and A will be the engine which

HyperCard has a "domenu" command that will call up any menu function
INCLUDING DA's in the Apple Menu. I've played with selecting a 
field (with "1+2+3=" in it), cutting it, calling up the Calculator
and Pasting this in. The Calculator dutifully calculates the answer.
This suggests writing your "engine" as a DA and having it communicate
with HyperCard through the scrap directly. No XCMD's needed.

If this suggests something, please let me know - I've got a similar
application in mind.

			    ---------
Tom Evans  tom@wcc.oz		|
Webster Computer Corp P/L	| " "I Know" is just
1270 Ferntree Gully Rd		|   "I Believe" with
Scoresby VIC 3179    Australia	|     delusions of
Australia			|      grandeur."
61-3-764-1100  FAX ...764-1179	|

englandr@phoenix.Princeton.EDU (Scott Englander) (05/26/89)

This is of interest to us also.  We're trying to make HC plot a graph
using Cricket Graph.  We've had success using MacroMaker, by creating a
macro called "plot," then doing a "domenu plot," which opens CG and then
runs a CG Macromaker macro which opens the file we just saved and plots
it.  Unfortunately, the macros break a lot, if things aren't just right,
and they aren't very exportable, and making changes means recording them
over again.  It would be great to be able to do this at the scripting
level, sending mouseups to buttons in another application's dialog
boxes.
-- 

                                               - Scott