home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14931 < prev    next >
Encoding:
Text File  |  1992-09-03  |  1.9 KB  |  42 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!usc!rpi!psinntp!psinntp!newstand.syr.edu!greeny
  3. From: greeny@top.cis.syr.edu (J. S. Greenfield)
  4. Subject: Re: Open file at launch time?
  5. Message-ID: <1992Sep1.225652.21499@newstand.syr.edu>
  6. Organization: Syracuse University, CIS Dept.
  7. References: <1992Aug31.070551.16993@midway.uchicago.edu> <5575@omphalos.bug.co.jp>
  8. Date: Tue, 1 Sep 92 22:56:52 EDT
  9. Lines: 31
  10.  
  11. In article <5575@omphalos.bug.co.jp> tague@omphalos.bug.co.jp (Tague Griffith ) writes:
  12. >
  13. >Under system 7.0, when your application is opened, the finder first sends the
  14. >application an kAEOpenApplication ('oapp')  apple event.  Your application 
  15. >should respond by doing anything it needs to do at startup.  Then the finder
  16. >sends your application an kAEOpenDocuments 'odoc' event which includes a list
  17. >of alias records to the double clicked files, resolve the aliases and then
  18. >open the files.  Pretty much the same thing with the print document event as
  19. >well.
  20.  
  21. Actually, under any normal circumstances, the finder will *either* send
  22. an "oapp" or an "odoc" but *not* both.  (That is, immediately after launching.)
  23.  
  24. If you get an "oapp" it means that your application was launched *without*
  25. any documents--and you should take any appropriate action--for example,
  26. opening a new, untitled window.
  27.  
  28. If you get an "odoc" it means that your application was launched *with*
  29. documents (those listed in the "odoc" event).
  30.  
  31. If you were to get *both*, it would (normally) indicate that the application
  32. was first launched without any documents, and then a document was launched
  33. (double-clicked, or dropped on the app, for example) *after* the app was
  34. already running.
  35.  
  36.  
  37. -- 
  38. J. S. Greenfield                                         greeny@top.cis.syr.edu
  39. (I like to put 'greeny' here, 
  40. but my d*mn system wants a 
  41. *real* name!)                        "What's the difference between an orange?"
  42.