Getting Mac OS X in Standby with Shell Command

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.

2 Responses to Getting Mac OS X in Standby with Shell Command

  1. andi says:

    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$

  2. David Wehr says:

    It didn’t work for me either, but this does:

    sleep 900 && /usr/bin/osascript -e ‘tell application “System Events” to sleep’

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>