I'm looking for a way to automatically log off a user after 30 minutes of inactivity, as well as close all open applications. As of now, there is really only one user to deal with. I'd prefer an easy (free) way of doing this, but am open to using a program that might accomplish the same thing. Thus far, I've come up with the following Applescript to close all programs and log out:
tell application "System Events"
key down {command, shift, option}
keystroke "Q"
key up {command, shift, option}
end tell
I'm not sure how to go about finding the period of inactivity. I don't have much programming experience, so any detailed step-by-step would be appreciated.

