Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Related to my other question on Windows, how would one go about creating a logoff script for Mac OS X?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

What do you mean by "logoff script"? If you mean "how to logoff current session from the terminal", then you can do this from any shell script or terminal:

osascript -e 'tell application "System Events" to log out'

If by "logoff script" you mean "a script that is executed when one logs off", then I invite you to read this nice post on that topic (with example scripts): http://www.bombich.com/mactips/scripts.html, or see the official documentation here: http://support.apple.com/kb/HT2420?viewlocale=en%5FUS

Another very nice example: http://www.macosxhints.com/article.php?story=2006081701162739

share|improve this answer
    
the second, yes - a script that runs at logoff, like the old "Shutdown Items" in the System folder on old version of Mac OS :) –  warren Nov 4 '09 at 9:45
1  
Here's another very nice and simple example on login/out hooks: macosxhints.com/article.php?story=2006081701162739 –  Zoran Nov 4 '09 at 9:56
    
would you mind adding that link (macosxhints.com/article.php?story=2006081701162739) to your answer, so I can accept it? –  warren Nov 9 '09 at 16:21
    
Sure, added the link to the response. –  Zoran Nov 10 '09 at 6:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.