Time To Shutdown

How can I set a timer (30 minutes) so my computer shuts down after 30 min is up?

Are you running OS X or OS pre-X? This forum implies pre-X because queries about OS X should be directed to AppleScript | OS X

Whoops, I wasn’t paying attention. I run OS X

Hi Harry,

save this script as stay open application and put it in startup items folder.
But I don’t know, whether the user will be asked to save open documents with
System Events’ shut down command

property shutdownTime : 30 * minutes
global timer

on run
	set timer to 2
end run

on idle
	set timer to timer - 1
	if timer = 0 then
		quit
	else
		return shutdownTime
	end if
end idle

on quit
	tell application "System Events" to shut down
	continue quit
end quit