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