• 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: launch an application, and on quit, logout?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: launch an application, and on quit, logout?


  • Subject: Re: launch an application, and on quit, logout?
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 24 Jun 2009 15:16:48 -0500

Here's a script that seems to do what you want. I'm using Mail here only as an example.

on run
tell application "Mail" to activate
repeat
tell application "System Events" to if not (exists process "Mail") then exit repeat
end repeat
end run

on quit
tell application "System Events"
log out
keystroke return
end tell
continue quit
end quit

I compiled to an application bundle with Stay Open = false.
When this application is launched, Mail is also launched.
When Mail is quit, you go to the login screen.
I did not test by adding this application to my Accounts Login Items,
but I'm sure it will work ... I've done this before with no problems.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >launch an application, and on quit, logout? (From: Mike Stanley <email@hidden>)

  • Prev by Date: Re: launch an application, and on quit, logout?
  • Next by Date: Re: launch an application, and on quit, logout?
  • Previous by thread: Re: launch an application, and on quit, logout?
  • Next by thread: Re: launch an application, and on quit, logout?
  • Index(es):
    • Date
    • Thread