Sometimes you leave the house and you Mac has to run for a little while, but then you want it in standby.
Here is a easy way to do this with a shell command.
Open a terminal window and type in the following:
sleep 900 && osascript -e 'tell app "Finder" to sleep'
This sets a 900 seconds (15 minutes) waiting time before putting the Mac into the sleep mode.
Did not work for me.
2011-01-23 01:47:07.803 osascript[74765:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
osascript: OpenScripting.framework – scripting addition “/Library/ScriptingAdditions/Adobe Unit Types.osax” declares no loadable handlers.
andreas-ditlers-macbook:~ andi$
It didn’t work for me either, but this does:
sleep 900 && /usr/bin/osascript -e ‘tell application “System Events” to sleep’