Tips January 23, 2005 at 12:26 pm

Logout Script

We have a client that uses a few apple computers as kiosks.

When a person logs onto the machine they want them to let it be active for 30 minutes then to have it logout. They also wanted the machine to warn them when they had 5 minutes left. I wrote an applescript that will do this. If anyone wants to use it your more then welcome to.Just paste this code into the applescript script editor and save it as a run only application. Add the script as a startup item for that user(s).

———-Script starts below this line———-
— Number of seconds script waits until the dialog comes up
delay 5

— Dialog with timeout
tell application "Finder"
with timeout of 5 seconds
display dialog "You have 10 seconds left. Please Save work." buttons {"OK"} default button 1
end try
end timeout
end tell

— Number of seconds until log out
delay 10

— Log out
tell application "System Events"
keystroke return
log out
keystroke return
end tell

Leave a reply

You must be logged in to post a comment.