• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detecting Launched Applet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting Launched Applet


  • Subject: Re: Detecting Launched Applet
  • From: Matthew Smith <email@hidden>
  • Date: Tue, 11 Dec 2001 00:57:06 +1100

on 11/12/2001 00:42, email@hidden at email@hidden wrote:

> I have an intersting problem that I've encountered. I have an applet that is
> in the Startup Items folder (OS 8.6 and 9.1). It runs everytime the system
> boots. On occassion, I need to run it manually. For reasons that aren't
> important to this problem, I need to detect whether the script has been
> launched on startup of the computer or manually by the user.
>
> Currently, I do this by checking to see if the applet is the current Finder
> selection (i.e. it was double-clicked, so it was launched by the user). That
> works fine, except it will fail if the script is run from an alias or from
> the recent apps menu in the Apple Menu, for example.

Split it into two parts, the applet which does all the work, and an applet
that runs it. The latter applet would be put in the startup items folder.
You would then create another applet which runs the first applet. This one
would be used when you want to run it on demand. To detect which one
initiates the main script you could pass a parameter to it. The value would
be different from each initiating script.

You may also want your script to remove the alias placed in the recent
applications folder.
--
Matthew Smith


References: 
 >Detecting Launched Applet (From: email@hidden)

  • Prev by Date: Re: Detecting Launched Applet
  • Next by Date: Disappearing Script menu
  • Previous by thread: Re: Detecting Launched Applet
  • Next by thread: Disappearing Script menu
  • Index(es):
    • Date
    • Thread