Logout user script
Posted
by
Baconlove
on Super User
See other posts from Super User
or by Baconlove
Published on 2013-09-19T13:24:00Z
Indexed on
2013/10/31
3:59 UTC
Read the original article
Hit count: 519
I am trying to create a script in ARD that will let me logout a user. Now I have a script which does start the logout, but I want it to execute instead of waiting 60 seconds. The script currently is:
osascript -e 'tell application "System Events" to log out'
As I said, this works but then I want it to press return on the logout dialog. The script I tried to make it do that is:
osascript -e 'tell application "System Events" to log out' -e 'keystroke return'
which doesn't work.
Is there a way, possibly by telling the system to press Cmd+Opt+q, then Enter, to log out without waiting for the timeout to expire?
© Super User or respective owner