Apple - Is there a way to absolutely force a Log Out, Shut Down, or Restart with open tabs and unsaved documents?

At my college, they had an app in the Dock whose icon was a white square with LOG OUT in big red letters. It ran a script (put together with appify or similar) that killed all running apps and logged the user off. This also helped with people who didn't know the Mac and didn't look in the Apple menu for the logout menu item.


You could create an AppleScript application, saved to the Desktop or other prominent location, that says

  do shell script "sudo shutdown -h now" with administrator privileges

The user double-clicks the shutdown script, gets a dialog box prompting for the password, and if it is correct, the shutdown proceeds. Note that this only works for accounts with administrator privileges.


There's also the shortcut Command+Shift+Option+Q to log out without confirmation, but it doesn't help when you have unsaved documents pre-10.7; it just avoids needing to hit Command+Q repeatedly. However, with Lion's Resume feature, this works as intended - leaving unsaved documents for the next time you log in.