• 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: Running Stay-open scripts from the command line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running Stay-open scripts from the command line


  • Subject: Re: Running Stay-open scripts from the command line
  • From: Michael Ellis <email@hidden>
  • Date: Sun, 20 May 2001 12:53:50 -0400

>i don't have an answer as to why, but a possible
>work-around: use osascript to run a stub script which just
>invokes your applet. then when the stub script quits, the
>target script will (theoretically) still be running.
>
>steve harley email@hidden
>

Thanks for all of the replies -- they've been very helpful.

The crux of my problem is that my application spawns an AppleScript
(using "osascript"), and I need the script to continually check for
certain changes (in my application). If I just have the script spin its
wheels checking for changes in an enless "repeat" loop, the CPU usage
goes throught the roof. For this reason, it seemed like a "on idle"
handler was the thing to do. Unfortunately, osascript does not invoke
the "on idle" handler as an Applet would.

So, I think I've settled on a compromise. I am going to have "osascript"
spawn my AppleScript, and I am going to allow the script to send my
application a "sleep" message. That message will cause the application to
send a "suspend" signal to the osascript instance. I will then send a
"resume" signal to the osasccript instance after a time quantum expires.
This will keep the CPU usage to a minimum and avoid needing an "on idle"
handler in my script.

Let's see how that works...

-Mike Ellis




==========================================================================
Michael Ellis Phone: 941-377-5562 x5169
Systems Analyst Manager FAX: 941-377-5590
Medical Education Technologies, Inc. (METI) Internet: email@hidden


  • Prev by Date: Re: Running Stay-open scripts from the command line
  • Next by Date: Re: Scope of globals, parents and children, "load script" and all that
  • Previous by thread: Re: Running Stay-open scripts from the command line
  • Next by thread: Re: Running Stay-open scripts from the command line
  • Index(es):
    • Date
    • Thread