Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!sif.claremont.edu!dwright From: dwright@sif.claremont.edu Newsgroups: comp.sys.mac.programmer Subject: Open Document AppleEvents--Sending(2nd time) Message-ID: <1991Jun21.130718.1@sif.claremont.edu> Date: 21 Jun 91 20:07:18 GMT Sender: news@jarthur.Claremont.EDU Organization: Harvey Mudd College Lines: 56 Well, I haven't gotten a single reply, so let me try again. I'm trying to send an Open AppleEvent to another application. The event is getting there, but the destination application complains that it can't open the file -- so I don't think I'm setting up the alias list correctly. I have code this time(!): function CreateOpenAppleEvent (theFile: FSpecPtr; theTarget: AEAddressDesc; var theAEvent: AppleEvent): OSErr; var err: osErr; temp: AEDesc; resultList : AEDescList; alias: AliasHandle; begin err := NewAlias(nil, theFile^, alias); {Create the alias} hlock(handle(alias)); err := AECreateAppleEvent(kCoreEventClass, kAEOpenDocuments, theTarget, kAutoGenerateReturnID, kAnyTransactionID, theAEvent); err := AECreateList(nil, 0, false, resultList); err := AECreateDesc(typeAlias, ptr(Alias^), sizeof(AliasRecord), temp); err := AEPutDesc(resultList, 1, temp); err := AEPutParamDesc(theAEvent, keyDirectObject, resultList); CreateOpenEvent := err; end; {CreateOpenAppleEvent} : : err := CreateOpenAppleEvent(document, theTarget, theEvent); if err = noErr then err := AESend (theEvent, theReply, kAENoReply, kAENormalPriority, kNoTimeOut, nil, nil); ---------- I've abbreviated the code a little (mainly the error-handling code) to keep it concise. NONE of the calls is returning an error. Any clues as to what I'm doing wrong?? >>Please reply by e-mail. Our news machine seems to go down without warning for weeks at a time without warning during the summer...:-)/:-( Thanks! Dan Wright (dwright@sif.claremont.edu or, if that fails, wwright@hobbes.kzoo.edu) ------------------------------------------------------------------------ Dan Wright dwright@sif.claremont.edu Harvey Mudd College '92, Claremont, CA