Logout after inactivity

Joined
Jul 24, 2012
Messages
2
Reaction score
0
Hi,

I've been trying to come up with some script that will automatically log out a user (only have one user set up) after a certain amount of time - i.e. 30 minutes. Since this will be a public terminal, it's been decided that after 30 minutes of inactivity, it should simply log off...and this means that the "Do you want to save changes...?" confirmation screens must be bypassed. (Otherwise, the log out will eventually time out.)

I've tried different variations, such as "tell application "loginwindow" to «event aevtrlgo»", with no luck - the confirmation windows regarding saving open applications still appear. Is there anyway around this?

I don't have much programming or command-line experience, and most things I've looked up were a bit over my head (I don't have the time to get into the vast inner workings of Unix at this point, unfortunately). I've come across a few recommendations for using various "killall" commands, but most seemed to require knowing the specific PID of the open applications. I just want it to close all applications and basically log out...no warning (harsh, yes) or anything of the sort.

I apologize for the length of this, but this seemed like it would be easier than it's let on. The Mac Pro is OSX 10.7.4, if that helps...I've used Macs, but haven't done much on the scripting end. Any suggestions really would be appreciated.

Thanks!
 
Joined
Nov 26, 2010
Messages
3,558
Reaction score
52
System Preferences > Security & Privacy > Advanced (Button) > Log out x minutes of inactivity
 
Joined
Jul 24, 2012
Messages
2
Reaction score
0
System Preferences > Security & Privacy > Advanced (Button) > Log out x minutes of inactivity

Thanks for the suggestion. That was the first measure I tried, but it still brings up the "Do you want to save changes?" window for unsaved documents that - if left unanswered - causes the logout to timeout.

I understand the function of this "are you sure?" type safety measure, but for this purpose, it's becoming quite frustrating to work around. Outside of some type of Unix "killall" type command (which I don't really grasp), I can't seem to find any other way around this.

Now if I only I knew Unix (or at least an easy way using Unix commands to close all applications/processes, bypass any confirmations, and logout)...
 
Joined
Nov 26, 2010
Messages
3,558
Reaction score
52
The reason you are having trouble is because the Mac is not designed to allow this. The Users unsaved data is sacred!

To start killing PIDs is just asking for trouble. There is a LOT of housework that goes on when you Quit an App. removing temp files, clearing caches, saving preference and so on...

Lion doesn't do this. When you Log Out on Lion it just Logs Out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top