Logout application

RogerH
Contributor II

I am working on a lab image for the university and on our windows image we have an icon on the desktop that just logs out the current user. How can I do this on the mac without admin rights? Automator? Applescripts?

1 REPLY 1

mm2270
Legendary Contributor III

Try this:

#!/bin/bash

/usr/bin/osascript -e 'tell application "loginwindow" to «event aevtrlgo»'

Or just extract the Applescript line (between the single quotes) and put that into an Applescript saved as an app. This action should do an immediate logout without confirmation, meaning open unsaved work could get lost if it doesn't support auto save or resume features.

EDIT: Removed the word "event" before the applescript event call as I realized it's not needed