Trying to write a script to logout an OS X session so that our lab patrons dont have to go up to the apple menu and choose logout. (i.e. In sight, In Mind). I feel that I am close but not there. If anyone can help that would be great.
the script:
tell application "finder" to restart
the problem is that the script hangs on execution, however after the script is force quit finder logs out.
JCK
: Trying to write a script to logout an OS X session so that our lab patrons
: dont have to go up to the apple menu and choose logout.
I’m trying to do the same thing, but have not been able to do it. I would also love to know how to get it to log in as a specific user as well.
I’m just using the native login screen to do that and authenticating it against out labs ldap. I do have the script figured out now though.
try
with timeout of 2 seconds
tell application "finder"
restart
end tell
end timeout
on error
--not looking for an error, but it does disable an annoying error dialog
end try