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
gdavis@primate.wisc.edu (Gary Davis) (05/26/89)
From article <8686@phoenix.Princeton.EDU>, by englandr@phoenix.Princeton.EDU (Scott Englander): > 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 I've used Wingz, which has a powerful macro language, to make plots from HyperCard. There are a couple of approaches possible; the one I used takes advantage of an "on activate" macro attached to a Wingz file. HyperCard places the graph data on the clipboard, then opens the Wingz file. The attached macro pastes the data into the sheet, then creates a graph from it. Since Wingz can run any text file as a macro, HyperCard could also prepare a complex set of instructions in a file to be passed to Wingz. I've also used HyperCard and Wingz in conjunction with the new word processor Nisus to automatically prepare formatted reports. Hypercard first uses Wingz to make a graph which is copied to the clipboard. Wingz then quits to HyperCard, which writes up the text of the report and passes the text file to Nisus. A macro in Nisus copies the graph into the appropriate spot in the text, formats the text, then prints the report. Nisus then returns to HyperCard, which can then start the production of another report, so an indefinite number of them can be produced automatically. Two features of Nisus make it easy to produce complex formatting. One, it possesses a powerful GREP which works with font characteristics, such as style, and two, formatted Nisus files are of type TEXT, with all the formatting and graphics in the resource fork. Consequently, HyperCard can open a Nisus file and write text into it while leaving any formatting intact. Gary Davis