Home » Questions » Computers [ Ask a new question ]

Create a logoff script/task for Mac OS X

Create a logoff script/task for Mac OS X

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

Asked by: Guest | Views: 182
Total answers/comments: 1
Guest [Entry]

"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_US

Another very nice example: http://hints.macworld.com/article.php?story=2006081701162739"