How to cut message "This computer has been scheduled to go to sleep automatically" and send it to sleep immediately? It's about a Mac mini connected to a touchscreen running at a public school, displaying a browser in kiosk mode. I want the Mac to go to scheduled sleep after school is over. 

Energy Saving PrefPane lets me set up a sleeping schedule. When the time has come that scheduled sleep should start, a prompt is displayed with that message mentioned in the subject, counting from 10min to 0 plus allowing users to abort that process.

To prevent anyone from aborting that process I'ld like to cut that message and send the Mac to sleep immediately when the time has come.

Is there any possibility to leave that message out?

Or any other alternatives?
launchd (ref) is the preferred method for scheduling events in OS X, as opposed to using cron.

Here is a method for putting an OS X computer to sleep at a specified time using built in OS X tools without the override alert prompt. Waking the computer up can still be handled via System Preferences → Energy Saver → Schedule.

First create the following shell script in /usr/local/bin named sleepnow.sh:

#!/bin/sh
pmset sleepnow


Then create a launchd plist file for scheduling a script to be run daily. It would look like this:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;org.myschoolname.sleep&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/bin/sh&lt;/string&gt;
        &lt;string&gt;/usr/local/bin/sleepnow.sh&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;StartCalendarInterval&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;Hour&lt;/key&gt;
        &lt;integer&gt;14&lt;/integer&gt;
        &lt;key&gt;Minute&lt;/key&gt;
        &lt;integer&gt;00&lt;/integer&gt;
    &lt;/dict&gt;
&lt;/dict&gt;
&lt;/plist&gt;


You would probably want to put this in /System/Library/LaunchDaemons/ with the filename org.myschoolname.sleep.plist. Adjust the time and name as needed.

You can load the plist using the command sudo launchctl load -w /System/Library/LaunchDaemons/org.myschoolname.sleep.plist or reboot the computer and it should be loaded on system startup.

If you are not comfortable with using launchd files and command line tools then search for the paid OS X app named Lingon which handles the creation of the plist file and loaded it.

Here is a good reference on pmset, which is the command line tool for managing power setting in OS X.

Although pmset can be used to set sleep and wake schedules, you'll still get that alert box on scheduled sleep. The pmset sleepnow command causes the computer to go to sleep immediately without an alert.