home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20166 < prev    next >
Encoding:
Text File  |  1992-12-22  |  3.0 KB  |  63 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcom.com!davek
  3. From: davek@netcom.com (David Kramer)
  4. Subject: Re: Detecting File Launch
  5. Message-ID: <1992Dec22.015110.21157@netcom.com>
  6. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  7. References: <1992Dec21.040009.26063@mcs.drexel.edu> <1992Dec22.112641.12944@waikato.ac.nz>
  8. Date: Tue, 22 Dec 1992 01:51:10 GMT
  9. Lines: 52
  10.  
  11. ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  12.  
  13. >In article <1992Dec21.040009.26063@mcs.drexel.edu>, udsugar@mcs.drexel.edu (David Sugar) writes:
  14. >> I am looking for a way to detect how a file was launched.  For
  15. >> instance I need to know if an application was launched by
  16. >> being double clicked or weather it was started at startup
  17. >> time because it was in the StartUp Items folder.  (I realize
  18. >> that I can check to see if the application is in the Startup
  19. >> Items folder but I need to see if it was user launched.)
  20.  
  21. >This check won't gain you anything anyway, since you might have been launched
  22. >via an alias in the Startup Items folder.
  23.  
  24. >> The reason for this is because if the Application was double-
  25. >> clicked I would like to bring up a preferences screen or
  26. >> something like that, but if the Application was run because
  27. >> it is startup time and the Application is in the Startup
  28. >> Items folder I would like for the Application to do whatever
  29. >> then quit without any user interaction.
  30. >>
  31. >> Any ideas??
  32.  
  33. >I don't think what you want is possible in general. I don't think the Finder
  34. >does any different processing for Startup Items than it does for a user
  35. >open request.
  36.  
  37. >Alternative: have a special document type. If you launch the application by
  38. >opening this, then you don't get the preferences dialog. Put a document of
  39. >this type (or an alias to it) in the Startup Items folder, instead of the
  40. >application itself.
  41.  
  42. >Or split the application into two parts: a faceless part that gets launched
  43. >at startup time, and a front end that the user has to open explicitly to
  44. >configure the faceless part.
  45.  
  46. >Lawrence D'Oliveiro                       fone: +64-7-856-2889
  47. >Computer Services Dept                     fax: +64-7-838-4066
  48. >University of Waikato            electric mail: ldo@waikato.ac.nz
  49. >Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  50.  
  51. Splitting your program works very well.  The best way I can think of is to
  52. make a cdev/appe combo.  Trashman 4.x uses this meathod, and I have found
  53. it very convenient to use.  When the Macintosh starts up, the appe in the
  54. extensions loads up into the background.  Then, if the user wants to
  55. change anything, they just open up the cdev and change the prefs.  The
  56. prefs might be put into a file in the preferences folder from which the
  57. appe could read and the cdev could read and write.  Or use apple events. 
  58. Get Trashman 4.x so you can see what I'm talking about. (I'm not sure how
  59. the Trashman cdev and teh Trashman appe communicate, be it a pref file or
  60. whatever.)
  61.  
  62. David Kramer 
  63.