• 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: Jaguar System Events app and log out
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Jaguar System Events app and log out


  • Subject: Re: Jaguar System Events app and log out
  • From: Bill Cheeseman <email@hidden>
  • Date: Wed, 09 Oct 2002 18:04:27 -0400

on 02-10-09 5:21 PM, Paul Skinner at email@hidden wrote:

>> I DO in fact know how to make the computer log out gracefully using
>> AppleScript, either with or without a log out dialog.
>
> Please, do tell.

In Mac OS X 10.0 and newer, the loginwindow application (in
/System/Library/CoreServices) responds to the Log Out ('logo') event.

In Mac OS X 10.2, it also responds to the Really Log Out ('rlgo') event.

Both events are declared in the AERegistry.h header file.

Because of the absence of a dictionary, you must send raw events to the
application to make these work. So:

Placing +event aevtlogo; in a 'tell application "loginwindow"' block and
running the script causes a log out window to appear. In Mac OS X 10.2 (I
don't know about earlier versions), the computer logs out after two minutes
if the user doesn't intervene.

Placing +event aevtrlgo; in a 'tell application "loginwindow"' block and
running the script causes the computer to log out immediately without a
dialog -- but only if you also enclose the raw Apple event in an 'ignoring
application responses' block. Otherwise, the computer won't be able to log
out until the script quits, and the script won't be able to quit until the
log out event signals completion. Deadlock, easily avoided by using the
ignoring application responses block.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont - http://members.valley.net/croquetvermont
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Jaguar System Events app and log out (From: Paul Skinner <email@hidden>)

  • Prev by Date: Re: OS X Name Extensions
  • Next by Date: Re: Mail 1.2 Account creation/modification scripts?
  • Previous by thread: Re: Jaguar System Events app and log out
  • Next by thread: Mail 1.2 Account creation/modification scripts?
  • Index(es):
    • Date
    • Thread