I've configured a local user account on an iMac (Lion) to immediately launch Firefox to a specific page after logging in – the page contains a survey to be completed by the user. This works fine.
What I want to do next but can't seem to figure out how is to automatically log off the user after they've completed the survey and they exit Firefox.
I don't want them to have to click the Apple icon at the top and then logout – when they finish the survey and exit Firefox, I'd like a script to execute that logs them out and takes the Mac back to the login screen for the next user.
Is it possible to associate a script and have it execute upon exiting an application?