AppleScript help

Gene Kennedy cyberscope at dca.net
Thu Apr 4 13:10:01 EST 2002


on 4/4/02 3:36 AM, Ian Summerfield at iansummerfield at btconnect.com wrote:

> I can't get my OS X system to shut down the power to the Mac:
> 
> Do "tell app " & quote & "Finder" & quote & " to shut down" as applescript
> 
> It doesn't work, revolution itself cancels the shut down because it's too
> busy waiting for a result from AppleScript to do the quit!  Can I fire off
> AppleScripts without waiting for the response?
> 
> Has anyone a better way to power off?  I get a message from my UPS that I
> have only ten minutes battery left and I want to cleanly shut down the
> system.


Ian,

What I have done to solve a similar problem is to write an AppleScript
application that contains the following two statements:

    Delay 5   -- this gives your Rev application time to quit.
    Tell application "Finder" to shutdown

Place the AS application in the same folder as your Rev application and name
it something appropriate such as "Quitter".

Then add an exit routine to your Rev application such as:

On ExitApp
    launch "Quitter"
    Quit
end ExitApp


This works well enough for me however, if you wanted a bit more
sophisitaction, you could replace the dumb delay statement in AS with a
procedure that checks the open processes and loops until your Rev app is no
longer among them.

Best regards,

Gene Kennedy




More information about the use-livecode mailing list